I think it's a kind of religious thing, and having successful sites around that don't follow the rules threatens their religion. http://paulbuchheit.blogspot.com/2007/06/dogmatic-programmer...
For all I know, my macroexpansions are ugly too. The whole point is that I don't have to look at them.
The usual alternative to html-as-object-code is to use a template system, but template systems seem to move as a group (and individually during development) toward being a way to write your usual language, but surrounded by HTML, which has the same problems I outline above, since the designer still has to mess with what's really application code. I suppose this is because template systems are usually designed by programmers, for programmers.
One of the promises of the web was that interface could be cleanly separated from the application itself, and it seems to me that most approaches being used today throw away that promise because the programmers assume that UI and design aren't important, or aren't hard.
In fact, there are many, many exceptions to my general rule that you'd want to eventually turn over HTML/CSS/design stuff to a designer, and news.yc is one, probably. But the vast majority of my projects are no exception, and I'm fortunate to be married to a designer with strong opinions on the matter, so I get good feedback. :)
But I do note the board does work well: is always up, does what it's supposed to, is easy to use, seems secure, and thus it just doesn't matter.
Another thing, is that you could reduce the HTML code a bit by using CSS more. The following example shows a <font>-tag inside a span...
<span class="comment"><font color=#000000>
Ever hear the horror story about what happens when Google rolls through your CMS that has the "delete" button as a link?
Using get instead of post for these kind of actions is just asking for trouble.
Edit: Or so I thought. I'm wrong.
It turns out there's no standard for this, so who knows what you can do today. But practically, Google Web Accelerator doesn't prefetch links with a query string, at least currently. So Paul's voting links are A-OK with GWA. And that's the only one that you need to worry about, at least today.
http://webaccelerator.google.com/webmasterhelp.html#prefetch...
I've edited my post. Thanks for your reply.
If HTML had a method="post" option on <a>'s then it would be no problem to always use the proper HTTP verb, but we have to satisfice with what we've got.
That said, if you're already using javascript (as news.YC is), I really don't see why you wouldn't make use of xhr. In which case you could submit the request as a post.
Note: I haven't poked around enough to see if news.YC works without javascript. If they degrade gracefully, more power to them, and I can almost understand the decision to do it the way they have.
In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe". This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is made aware of the fact that a possibly unsafe action is being requested.
Naturally, it is not possible to ensure that the server does not generate side-effects as a result of performing a GET request; in fact, some dynamic resources consider that a feature. The important distinction here is that the user did not request the side-effects, so therefore cannot be held accountable for them.
A lot of deprecated methods are still used because they work reliably, whereas the replacement often didn't, until much, much later. People remember the pain and bugginess and so you lose the early adopters even if the problems eventually get fixed. Cf. Apple III, g++, MySQL.
CSS is awesome for many things--but blindly using it everywhere isn't a smart choice.
However for this web site, Yes it just doesn't matter.The functionality become more important.There is news link and comment section with a clean interface. Not much black ink.
If you are in this situation, it doesn't matter but with your new startup's i think its better stick with the notion of separating mark-up with design.
I can't keep silent to those anti-css comments but don't know where to start...i think web started as a way of exchanging "documents" between computers. So in basic terms what you see in your screen is "a document" so it should be seen as " a document". without css in html code what you see is...well some kind of hectic ASCII art.
"It is a valuable thing if your page seen as a document"
i sometimes think that, under the supervision of PG, a small design team (designer, info. arch. & UI person) "may" help founded startups to achieve better in their goals.
Paul basically said he doesn't give a shit, which is pretty stupid considering how many people visit the site regularly, and how poor the user interface is. Just because spacer gifs don't directly affect the content, those kinds of poor design techniques influence the user interface and make it crappy, which it has become. Paul, you know good designers-- get them to make it look good.
Besides, it works in all browsers, is reasonably accessible, and if it doesn't make him uncomfortable to work with it...why does anyone care?
function byId(id) { return document.getElementById(id); }
My guess is that the function body is rendered differently for different browsers. If that's true, it's a clever way of doing cross browser Javascript.
And another clever way of doing cross-browser JavaScript is just to use a mature JS library like Prototype or JQuery. They all give you byId for free, in the form of the $ function.
Call me a fanboy, but I consider "works in <b>all</b> browsers" a misfeature. "works in all reasonably standards-compliant browsers" is a much better goal, I say. If people didn't support obsolete and/or mediocre software like that, we would all have had almost fully standards-compliant browsers 4 years ago.