The Cruelty of Unattainable Perfection

First, there was pristine perfection: a vision of a mark up language that was simple, intuitive, and made your online documents look reasonably pretty. Then… well, then everything went to hell in a hand basket. In a little over a decade, HTML became the clumsy, disfigured, and repulsive Frankenstein of a language that it is right now. Not only the language itself is full of atavistic lexical protrusions and semantic dead-ends, its implementation, until very recently, has been a tale of creative standard interpretation and compliance infidelity.

Those of you, who spent countless hours trying to make a fairly simplistic layout work correctly in multiple browsers, would readily agree with me. In fact, the process of coding a HTML and making it cross-browser-compliant has become something of an encryption: once you got the thing done, it is easier re-code it from scratch than to make edits to the code (unless, of course you don't care and are willing to "dreamweaver" it together – ah, the familiar "duct tape" solution).

Not all is lost though. With the help of enthusiasts and browser developers, W3C is slowly but surely trying to bring the ship about and put an end to the madness. "Let content to be content", they said. So the cascading style sheets (CSS) were crowned the new king of layout.

Since then, we've gone a long way. CSS2 is now a reality. CSS3 is taking shape as we speak. Just a bunch of lone madmen on a street corner a short while ago, the proponents of standards-based HTML development are gaining popularity and support.

I, too have succumbed to the beautiful idea of content-context separation, and made a good effort in adopting standards in HTML code development.

And you know what I've found out? It's still about hacking. Although not as terrible as before, programming with CSS is still an imperfect process. Go to any of the Web sites that talk about CSS. What will you find? Lots and lots of hacking around the uneven browser support and just plain limitations of the specification itself. Let me give you an example: suppose you have a div element that contains a ul element with an arbitrary number of li elements:

<li>line item 1</li>
<li>line item 2</li>
<li>line item 3</li>
<li>line item N</li>

Just content, right? Now, here's a pop quiz: make this render as a neatly centered horizontal navigation bar, like so:


Done? Now, was it worth that much work? Why does it have to be this hard?

Yes, this is still better than the "nested-table encryption", yes, we are getting closer to perfection. But the cruelty of the situation is that we need this to work now, without resorting to building tables upon tables to control the layout…

Leave a Reply

%d bloggers like this: