Gray Watson Personal Thoughts 2003.04.17
How to Write Web Pages

[ I started this mail to a friend who asked me about writing web pages and have decided to copy it here. He didn't ask for a sermon but I hope he, and you, find some useful information here. As always, your mileage may vary. ]

I'm an old-timer on the web. I remember when the alpha version of Mosaic came out and how cool it was. I started writing HTML when there were no tools to write it and most of the web pages were generated with a text editor by hand. I learned how to write HTML by pulling down a menu to View Source to see how someone accomplished a certain interface or dialogue.

Really, very little has changed for me in terms of how I write web pages since the early 90s. As I write this page, for example, I am typing into an emacs text editor buffer. I am certainly not alone in writing web pages this way but I am certainly not in the majority. What has changed for me is my knowledge of and my adherence to web standards. Although the web is still very much anarchy, at this point there are a lot of great standards, documented best practices, style guides, tutorials, and reference material. Very little of it is used by the large majority of the web developers out there unfortunately.

So here are my general thoughts on the subject.

  1. First off, if you are considering a career in web design, please keep in mind that web designers are, frankly, a dime a dozen. You can put HTML and web design on your resume but it should be a footnote only. If you think that by creating some web pages for your uncle's garage qualifies you for a position, you need to think again. It is a valuable skill that may serve you well but unless you have other expertise it probably won't pay the bills.
  2. You should always write well formed XHTML. Take a look at the WWW Consortium pages and learn about the available standards and validaters. Great stuff.

    You can see that on the bottom of most of my pages I have a link to the XHTML checker so I can easily verify that my pages are valid. This also encourages people to know about the standards. Here's the html code if you want to put the validator on your pages.

    <p><a href="http://validator.w3.org/check/referer"><img
        alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
  3. So, as I've mentioned, I write my HTML in a text editor. Most other people, however, use Frontpage or other web design software to write their pages -- some out of ignorance and others out of necessity. One of the unfortunate byproducts of this software is that it produces, with some exceptions, completely unreadable HTML. If you pull down a menu in your browser to view the source of this page, you can see relatively easily read HTML. I have some included header and footer templates which screw things up, but otherwise it should be well formed, well spaced, and easy to parse. Try doing this on the Lycos home page for example. Bleah.

    All this said, get into the habit of viewing the source from web pages often. The more you feel comfortable with the source, the better your pages are going to be.

  4. Your web pages should be usable by a wide variety of browsers. To quote Tim Berners-Lee in Technology Review, July 1996:

    Anyone who slaps a "this page is best viewed with Browser X" label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network.

    You want your pages to work for people on Macintoshes. You want the blind to be able to use screen readers. You want your uncle who is still using Windows 95 and IE4 to be able to enjoy your site. I work for Lycos and I constantly hear someone say "well, we don't have to develop this page for non-IE browsers because there are so few of them". I find a couple of things wrong with this sentence.

    • This is a self fulfilling prophecy. If no one develops pages that work on other browsers then Microsoft's monopoly will be complete. Does anyone think that no competition is a good idea?
    • If your site doesn't work with Mozilla then, wait for it, no one using Mozilla will visit your site. You should never use your own browser statistics to make a decision.
    • Browser statistics vary greatly depending on the source of the information. I have seen IE 5&6 listed from 75-95% of the browser market. So you have no problem with 1/4 to 1/20 of the people that visit your site being unable to navigate it? Look at the most popular sites on the web (not MSN) and try and find places where they require Microsoft browsers. Get it?

    In general, pages which are friendly to all browsers are usually leaner, more faster to download and render, provide a better cleaner/simpler UI, and are generally more usable. You can't do the fun tricks that only IE supports but those will often come back and bite you.

  5. Lastly, you should know about Cascading Style Sheets. Not all browsers have full support for it yet but it is the present and future of web pages.

That's all for now. Hope this was of some help.

Free Spam Protection   Eggnog Recipe   Android ORM   Simple Java Magic   JMX using HTTP   OAuth 2.0 Simple Example   Great Eggnog Recipe   Christopher Randolph