6 ms·
Ask HN: Why is HN HTML laid out in tables?
Hacker News is certainly not HTML5 friendly. Heck it doesn't even validate in HTML4 http://validator.w3.org/check?uri=http%3A%2F%2Fnews.ycombinator.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0
<body><center><table border=0 cellpadding=0 cellspacing=0 width="85%" bgcolor=#f6f6ef><tr><td bgcolor=#ff6600><table border=0 cellpadding=0 cellspacing=0 width="100%" style="padding:2px"><tr><td style="width:18px;padding-right:4px"><a href="http://ycombinator.com"><img src="http://ycombinator.com/images/y18.gif" width=18 height=18 style="border:1px #ffffff solid;"></img></a></td><td style="line-height:12pt; height:10px;"><span class="pagetop"><b><a href="http://news.ycombinator.com/news">Hacker News</a></b><img src="http://ycombinator.com/images/s.gif" height=1 width=10><a href="http://news.ycombinator.com/newest">new</a> | <a href="http://news.ycombinator.com/newcomments">comments</a> | <a href="http://news.ycombinator.com/ask">ask</a> | <a href="http://news.ycombinator.com/jobs">jobs</a> | <a href="http://news.ycombinator.com/submit">submit</a> | <font color=#ffffff>joeybaker's comments</font></span></td><td style="text-align:right;padding-right:4px;"><span class="pagetop"><a href="http://news.ycombinator.com/x?fnid=0uLs1HxN7c">login</a></span></td></tr></table></td></tr><tr style="height:10px"></tr><tr><td><tr><td><table border=0><tr><td> …………
- maukdaddy 16y agoBecause despite what the CSS purists say, tables work damn well for laying out content.
- citricsquid 16y agoJust like an iPad works as a door stop. edit: heh, downvotes. I am not a "css purist" there are times when tables are the correct solution, but they aren't here. Just because "it works" can be said that doesn't explain/justify their use.
- patrickaljord 16y agoDo you really think that the only reason to use CSS over table is because of purists? CSS is much easier to manage than tables and css frameworks have fixed all issues related cross-browsers problems.
- rgrove 16y agoAssuming you don't care about blind users, yes.
- beoba 16y agoIt doesn't claim to be HTML5 to begin with.
- mixmax 16y agoBecause it works. No mucking about with CSS overflows, stuff that jumps to the next line, things that don't align, etc.
- deleted 16y ago[deleted]
- teej 16y agoBecause it doesn't matter.
- joeybaker 16y agoSure, unless you'd like to validate, parse, maintain, or change the codebase. edit: oh, and proper markup is faster.
- bradleyland 16y agoIf someone writes C/Python/Lua/language-of-your-choice code that violates good principles, misuses constructs, and generally looks like crap, everyone calls them a lousy coder. Yet when it comes to HTML, using semantically incorrect markup is somehow ok. I understand why pg hasn't updated the display markup, and it's his website, so he can do what he likes with it, but to say "it doesn't matter" is to give anyone writing bad markup a pass. It degrades our artform. That matters.
- beoba 16y agoWhat's 'incorrect'? It's just following an older standard. Will all existing C++ code be 'incorrect' once C++0x is finally released?
- prodigal_erik 16y ago<table> has a meaning. It expresses recurring, orderly relationships between <th> and <td> elements. It has always been incorrect to cram in content that isn't semantically linked that way, purely to exploit a typical rendering of it. It was incorrect even when there existed no supported way to request a similar rendering, though that was a reasonable excuse if you only cared about appearance.
- nostrademons 16y agoPart of being a good engineer is understanding tradeoffs and figuring out when contextually-dependent knowledge doesn't apply. IMHO, it doesn't matter - for Hacker News. That's independent of whether it matters for whatever website you're being paid to write at any given job.
- olalonde 16y agoHere's pg's official answer (http://news.ycombinator.com/item?id=1998708 http://news.ycombinator.com/item?id=1998708) : why is the UI so completely neglected? Because when I spend time on HN my top priority is features that will make the content better. I believe that matches the priorities of the users-- that users would rather use a site with good stories and comments and a primitive UI than one with a slick UI and worse stories and comments. And time is a zero-sum game. Spending more time on UI = spending less on quality. The focus on content quality above all is the reason you find yourself saying later "If there were any other community like this..." [...]
- jpdugan 16y agoThe OP isn't talking about Ajax calls and Dom transformations. He's talking about using semantically correct markup (c'mon, it is literally an ordered list) and a style sheet. Things that would make the site faster, easier to maintain, and easier to parse. If this were anyone other than pg, you'd all be excoriating the developer for living in the 90s.
- joeybaker 16y ago"If this were anyone other than pg, you'd all be excoriating the developer for living in the 90s." ← Yup, that was my point.
- pg 16y agoIt wouldn't make the site easier to maintain. This stuff is all generated by software. All that would change is what the software generated as output. How much faster would HN pages render if they used "semantically correct markup?"
- jpdugan 16y agoWhy are you generating styling at all? It's not dynamic information. It's a static asset that can be cached. Semantically correct markup uses fewer tags, so the output is smaller (also, there'd be no online styling, which would also make the page smaller). Even a small difference on a popular site could matter. But only you can answer that for HN. Look, do what you want. You want to write bullshit markup, be my guest. But there isn't a single web dev in this community who would code output like this for their own site. They're just too chickenshit to tell you.
- profquail 16y agoI rewrote the HN markup to use XHTML + CSS + MicroFormats last year, but never got a chance to re-write the actual templating code in news.arc (http://www.arclanguage.org http://www.arclanguage.org). If anyone's interested in finishing that last part, let me know and I'll be happy to send you the templates and stuff I made. I also added some rudimentary support for mobile-specific stylesheets and scripts.
- deleted 16y ago[deleted]
- dpurp 16y agoi don't know if i'll have time to finish anything, but if you would like to send it to me (email in profile), i'd be interested in looking it over and trying it out.
- Mz 16y agoI know a lot of folks here are actual programmers (unlike me, I mean) and can nitpick anything to death, but maybe folks have missed the part about HN being a little side project that exists to serve the goals of YC? It isn't a high priority for PG. YC is the real business. This is a free service and it serves some of YC's needs but there are no ads, it isn't monetized, etc. Unlike some of the websites folks here own, it seems to me HN does not provide enough value for pg to justify jumping through hoops backwards, blindfolded and on fire to make folks here happy with some cutting edge, WOW! coding. (Personal note: Now I feel better about my sites being laid out in tables. :-P)
- Kilimanjaro 16y agoI said it once and got downvoted to hell. I'll say it again. By removing tables and moving all styles to a separate css file you can cut page size in half. HN is in need of an urgent redesign.
- angdis 16y agoI've all but given up giving a damn about web standards. No one _REALLY_ cares. Not the uses, not the developers, not the w3c with their open-to-interpretation "recommendations", and ESPECIALLY NOT browsers vendors who, for various reasons, aren't able to nail down a consistent interpretation of web standards. The choices are to use a framework which does the shit-work for you, or resort to lowest-common denominator "whatever works" techniques like HTML tables.