Coding - Issues

HTML - a little history

HTML is a language designed to code the structure of your text documents. Over the years, browser manufacturers have added propriety tags (some of which became standards) to control the appearance of documents. And designers, on their side, quickly discovered they could use a "hacks" and "workarounds" to force HTML pages into a (more or less) rigid layout.

While this could be seen as a good thing, it quickly created a real mess: different browsers would support different tags, and a page written with a certain "look" in mind for one browser would come up broken in the other.

This brings the need for people to agree on what is and is not HTML... enter standards.

Need for standards

Standards are necessary to ensure that your page will look the same in every browser. HTML is a language, and as a language it has a syntax and a grammar. Browsers follow these rules to "decode" it and render it. But if nobody agrees on what the rules are, pages will look different in different browsers.

Hence standards.
The present browsers aren't 100% standards-compliant, but we are getting near enough. If you view this page in Netscape 6, Internet Explorer 5, or Opera 5, you can be pretty sure it is how I intended it to look. My pages are standard code (if they don't validate, be sure an "&" is hiding somewhere in a third-party url...).

This means your code needs to validate. Or very nearly.
Same thing for your CSS.

Being satisfied with "My page looks ok, why should I go and mess with the code?" is an approach which will not give long-term satisfying results. Your page will break at one moment or another.
And the fact is, non-standard code (often generated by an editor) is much more redundant and heavy then standard code. Your pages will be bigger and slower.

You'll find much more discussion about the need for standards at webstandards.org. And be sure to listen to CodeBitch.

WYSIWYG versus hand coding

I'd gladly use a WYSIWYG editor like Dreamweaver or Frontpage. But they don't produce standard code (it's usually quite nasty-looking), and HTML is simple enough to learn and use that it's not really worth the hassle of creating a page in the editor and then cleaning up all the messy code (at least for what I do).

Plus, I doubt you'll ever manage to talk your WYSIWYG editor into producing the advanced layout techniques developed recently using only CSS. Or if you do, it will probably demand much more energy than simply doing it by hand.

Now, I know, just because I say you should handcode doesn't mean you have to do it. Here is a little more to make you think about this issue...

My main aim here is to convince beginning coders of the importance of learning HTML. If you are a long-time DreamWeaver user and are happy about it, remember... this isn't directed against you!

<rant>

First, remember that every line of code on your page will have to be downloaded by your visitors. And WYSIWYG editors produce a lot of superfluous code. It will take you much more time to clean it up than to write it clean by hand to start with.

I'm not saying you should never use an editor. It is OK to use an editor once you know the code. Just don't use them to save you from learning it. You'll pay in the long run.
Current editors simply aren't good enough now to be used blindly, and you'll end up learning the code anyway at some point - or giving up. And that's a pity.

Learn the code straight away - it's not that hard. The "myth": HTML is an inpenetrable, complicated and obscur language is perpetrated by WYSIWYG editors.

Go on, fire up ScreamWeaver. Make a page. Look at the code. Of course, you'll say: "Thank goodness I used an editor, I never could have produced all this mess by hand!" - I wouldn't be able to either, and neither would any of the professionnal web designers out there.

Do you see how it works? WYSIWYG editors make HTML look much harder than it really is. Of course they do. It's in their interest. If editors made code look as easy as it is, who would use them anymore?

</rant>

To sum it up: handcode! There's nothing unethical about WYSIWYG editors. It's just that in the current state of affairs, you have to keep the control of your code. And that is much simpler to do when you handcode than when you WYSIWYG-code - especially when you're learning.

Of course, you don't have to use Notepad. There are much nicer text editors for HTML around. HTML-Kit is the HTML text editor I use. EditPlus is nice too, but it wasn't quite flexible enough for me. And of course, there is Allaire HomeSite.

You might be interested to read this discussion list thread on requested feedback about Dreamweaver from designers on the XHTML-L list.

Advantages of using CSS

The necessity to use CSS should seem obvious from the above. In addition to addressing the "standards" issue, it makes maintenance of your pages much easier.
No more hunting for dozens of <font> tags if you decide to make a minor layout change. Just edit the stylesheet and all your pages will change.
It also allows you to serve different stylesheets to your audience - either to "customize" your site or to provide a printing version.

For a more complete discussion of this topic, please see the CSS basics tutorial.

::: discussion :::

This site will look much more pretty in a browser which supports web standards, but it is accessible to any browser or Internet device. Browsers which do not support CSS will get this message, even if they are otherwise standards-compliant. Do you want to upgrade?

French - français! Ce site aura l'air bien plus joli dans un navigateur conforme aux standards du web, mais il est accessible avec n'importe quel navigateur ou dispositif Internet. Désirez-vous faire une mise à jour?