Locking down the Web

All timestamps are based on your local time of:

Posted by: stak
Posted on: 2008-09-10 23:42:54

And this, my friends, is the reason why User-Agent strings (well, user-agent detection, at least) suck so much. It's exactly the same problem we're going to run into in a few years with object detection in Javascript, which also sucks. I have a strong dislike for the people currently working on some of the upcoming specifications for the web, because they seem to be encouraging this sort of stupid behavior with their short-sightedness. I grant that Microsoft couldn't have known the mess it was going to create when it first put "Mozilla" in their User-Agent string, but there's no reason we should keep making the same mistakes over and over.

The creators of the DOM specifications even put in feature-detection support right into the DOM precisely to avoid this sort of problem, but nobody seems to realize that that's what it's there for, and insist upon using inferior alternatives simply to save a few characters in code. Sigh

There comes a time in every person's life when they need to move out of their Mom's basement and get a place of their own in order to grow. The same is true of the Web. We need to stop treating it like a kid and coddling it with ugly hack after ugly hack. It's all grown up, and the mess of tag soup parsing and quirks mode layout needs to be thrown out. Sure, the Web wouldn't be where it is now if browsers hadn't allowed developers to be so sloppy with their HTML, but if we continue to allow that sloppy HTML the Web will never realize its true potential. This is true for any serious project - you put in a lot of quick-and-dirty hacks for prototyping and to get something up and running quickly. However, the dirty hacks eventually need to be thrown out or turned into something more solid and well-defined. Some of the W3C contributors seem to think that the Web is somehow special and exempt from this, but it's not. If the HTML5 spec is ever finished, it may well turn out to be the thing that locks the Web in the basement.

Sorry if my metaphors make no sense (really, they made sense when I was thinking about it) but on the bright side, at least I've found something else I can rant about.

Posted by Fai at 2008-09-13 02:05:51
And while we're at it, can we not send javascript as a string?
[ Reply to this ]
Posted by stak at 2008-09-13 14:42:22
*confused*... Is that a question, or a request? And what do you mean by "a string"?
[ Reply to this ]
Posted by Fai at 2008-09-14 03:29:52
request, for when you make the web not a hack.
I mean a string. you know, collection of characters.
[ Reply to this ]
Posted by stak at 2008-09-14 07:45:14
But it's always going to be a collection of characters. That's how data is transferred on the intertubes. What's your non-string alternative?
[ Reply to this ]
Posted by Fai at 2008-09-14 14:06:34
[ Reply to this ]
Posted by stak at 2008-09-14 14:24:32
So you want javascript to be compiled on the server? Why?
[ Reply to this ]
Posted by Bill at 2008-09-15 17:13:04
The two reasons that come mind are: the client doesn't have to parse the the javascript; and an efficient byte code representation will probably be smaller.
[ Reply to this ]
Posted by stak at 2008-09-15 17:56:51
The client will still have to parse something, unless you're sending down machine code ready to be executed. I agree a binary format would be more efficient on the client, but conceptually it's the same thing. My post wasn't so much about optimizing the specific nature of the content being thrown around on the web as it was about high-level decisions that have a large long-term impact.

Also, one of the reasons javascript is so popular is because it doesn't need to be compiled; the edit-run-debug cycle is really fast, and being able to debug interactively inside the deployment environment (the browser) is pretty awesome. People who want to optimize the content sent down to the client have come up with lots of ways (self-packing/obfuscating code) to do so. Believe me, that "optimized" content has caused us (the browser dev team at RIM) to suffer through many days and many nights of tortured anguish.
[ Reply to this ]
Posted by stak at 2008-09-15 18:45:28
It seems Tim Berners-Lee has heard my pleas. Yay!
[ Reply to this ]

[ Add a new comment ]

(c) Kartikaya Gupta, 2004-2024. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!