6 ms·
Ask YC: Why is YC's layout table based?
I'm a big fan of HTML, and I really don't understand why Hacker news is using tables instead of lists.
Lists make a lot more sense than tables in this case, also the CSS will be easier to modify.
- divia 19y agoThis came up a while ago. pg's answer was "Because we're smart enough to realize that html is object code?" http://news.ycombinator.com/item?id=50154 http://news.ycombinator.com/item?id=50154
- ayc 19y agoThat is. Table is 'not optimized object code' compared to lists. So you should ask: why your object code is not optimized (and it slow loaded and slow rendered on my PC :).
- emmett 19y agoHow old is your computer? I've found news.yc load times are close to instant.
- mrtron 19y agoHaha...I can imagine its a quad core, 4 gigs of ram and running vista. :)
- ayc 19y agoRight!
- run4yourlives 19y ago>How old is your computer? On the internet, it shouldn't matter. :)
- ayc 19y agoMy computer is fast :) I told "YOU should ask: why your object code is not optimized (and it slow" (instead of "why you use tables").
- palish 19y agoPremature optimization is literally a waste of life.
- ayc 19y agoDo not waste a life! You should use optimizing compiler ;)
- brett 19y agoPG might tell you it's because html is object code: http://news.ycombinator.com/item?id=50159 http://news.ycombinator.com/item?id=50159 But then you'll note that his code is full of tab, tr, and td macros so it's not like html tables are completely abstracted out. So a better answer might be that he puts a premium on quickly getting things out that work and ignoring details that the user never knows about; I'm guessing you didn't know the page was table based until you looked at the source. I'm also guessing that it's as easy for him to make arc changes as it would be for you to make the corresponding css changes (were the page list based).
- german 19y agoYou're right, I realized that the page was table based by looking at the source. Programmers love to read beautiful code, As a web designer, I love to read beautiful and meaningful HTML. ;)
- randallsquared 19y agoTables are embedded in the Arc code for news.yc, as brett mentioned, but probably it could be rewritten in a few hours for a list-based layout. Of course, changing the layout would require an Arc developer, which is the disadvantage to not using templates. You may have noticed that most hackers seem to think web design is unimportant and/or should require a programmer for each change.
- curi 19y agoAs a programmer, I can tell you I really don't mind that changing my website requires a programmer. It's perfectly convenient for me. The only reason to do something differently is a client requirement, or a desire on my part to get someone else to do stuff for me.
- randallsquared 19y ago> As a programmer, I can tell you I really don't mind that changing my website requires a programmer. It's perfectly convenient for me. That's refreshingly honest. :)
- juanpablo 19y agoI think because it's easier... for him. I don't like it either though.
- mrtron 19y agosmacks head Not this again... The answer being who gives a shit? Does it look fine in most browsers?
- halo 19y agoWho gives a shit? Hackers. And, y'know, with this happening to be Hacker News and all, it works.
- imsteve 19y agoYou can't "hack" html or css, they aren't languages. Furthermore, CSS is a lie. A lie for designer snobs.
- cedsav 19y ago...says the developer snob.
- imsteve 19y agoYou can use tables or css, I don't care. Forcing one over the other is rediculous though. And yes, only snobs insist on never using tables.
- randallsquared 19y agoOh, so when everyone keeps saying the cake is a lie, they mean "CSS" by "the cake"?
- imsteve 19y agoAnd where do smart people put their cake? On a table, that's where.
- jfoutz 19y agoIt's been pointed out that HTML is not Turing complete. You can interpret a page as a state and a link as a transition. That makes HTML the equivalent of regular expressions. Definitely worthy of the title hack.
- samson 19y agoI think PG must have known, what I only ended up finding out myself after trying too hard to make everything CSS, is that it doesn't always need to be. I kinda wish I could have an outter body experience +add that with time travel, and go back a few months so I can kick my old self in the ASS(twice) for wasting hours trying to make a forums page in all CSS, only to give up and accomplish it with tables, in what felt like seconds compared to the time I had spent previously. CSS is of course a really good thing, especially if your building a big site(my site still mainly CSS based), But there's no need to spend unneeded time on things that the end user won't see,notice or care.
- cedsav 19y agoCSS has a learning curve yes, so it always going to seem harder than it should be in the beginning, but otherwise it shouldn't make a difference time-wise to create a table or css based layout.
- palish 19y ago... Until you realize that your fancy CSS doesn't display properly in IE6.
- run4yourlives 19y agoWhich, on a site like this, can be safely ignored! :)
- palish 19y agoSo you admit that fancy CSS for mainstream sites is generally a huge time sink?
- run4yourlives 19y agoNo, spending time correcting bugs of a browser that 3% of a particular site's users actually use is a waste of time. Correcting IE6 bugs on a mainstream site is part of the job. (and not that bad once you get the hang of it unless you've got a heavy design) I'd be very surprised if a CSS version of Hacker news needed any IE hacks at all really.
- icky 19y agoBecause it's Hacker News, not Designer Gallery.
- ashu 19y agoCSS is used for two purposes: for styling and for layout. In my mind, the value obtained by using CSS for larger site layouts is not much. Usually, the claim is that CSS layouts help you re-target the content for another device and stuff, easily. Based on my experiences, I think that's a grand dream not likely to come true. You have almost completely re-think your UI when you are developing for a different device. Re-using CSS layouts is nearly impossible for that.
- ericb 19y agoI agree. CSS as a layout system is poorly thought out and even more poorly implemented. Why, to center an object, do I have to remember trivia like "the parent needs a width." You need hacks and non-intuitive tricks for cross-browser CSS. Tables are verbose, but they "just work" more often. I still use CSS layouts, but man what a steaming pile.
- run4yourlives 19y ago>Why, to center an object, do I have to remember trivia like "the parent needs a width." Because you're still viewing the page as a table. Once you stop doing this, you stop asking questions like these.
- ericb 19y agoI'm open to new perspectives. In what way I should I see the page such that "center me in my parent" is unreasonable unless the parent has a fixed width? What, in particular, about the box model makes this impossible?
- run4yourlives 19y agoThe notion of "center" doesn't exist without a width. Now, you could give the object in question a width and simply give it margin-left/right: auto. That would center it in the width-less parent, but it wouldn't fix its position to the particular spot you're currently seeing it in. For understanding, take it up to the highest level, the browser window. Make your browser 1024x768. Now make it bigger or larger - where is the "center"? It's moved depending on the size of the browser window. If you have a parent whose width is variable, you can't center the child. The key is that, unlike years of using tables to hack up a website, the canvas CSS uses is variable; its height and width is undefined. Thinking of it like this, it makes perfect sense that center isn't used.
- ivan 19y agoBecause you should read news not the source code.
- rugoso 19y agoLOL, this is always one o my favorite insults, "he uses tables in his html"
- sbraford 19y agoalong with "i heard he produces invalid markup" (cue beavis & butthead laugh)
- run4yourlives 19y agoMost likely because PG or whomever else coded the site doesn't know how to use HTML with CSS, doesn't care to learn, and doesn't think it's important enough to learn. People might down-mod me for that, but it's basically the truth. Now, the only real benefits that Paul would probably consider CSS giving him would be the bandwidth usage (stylesheets are cached) and maintenance issue. I can't imagine either of those two would be enough to coerce him into learning a whole new way of doing things. I certainly think that PG is missing many more benefits by not coding the site properly, but from his vantage point, (and everyone else who would see learning css as confusing and pointless) it's likely that the risk/reward assessment is not pointing in favour of a tableless layout.
- pg 19y agoBecause the data is tabular?
- german 19y agoI have to disagree with you Paul, A list suits much more this kind of data than a table.
- run4yourlives 19y agoUm, Tabular data of a single column is usually referred to as a list. :-) Seriously though, it's not just a list, it's an ordered list.
- palish 19y agoIt's not just an ordered list! It's also a database! But seriously, you can play that game forever. At some point, you have to pick one definition and stick with it. This site uses tables.
- run4yourlives 19y agoThat's just it though, it doesn't. It simply uses tables to display the list, when it doesn't have to. Not worth arguing over in all but the lowest levels though.
- pg 19y agoThere are only three columns on the front page now, but when I was working on the site I experimented with different layouts in which there were more. Why constrain myself by using a degenerate case of tables? I can't believe this thread has 49 comments (and counting). What a classic bicycle shed.
- run4yourlives 19y agoWell, you're participating... :-p But seriously, what do you mean degenerate case of tables? CSS? I suppose my biggest gripe is a statement like that; once understood and learned, HTML w/ CSS is actually easier to use. It's easier to code, re-code, fix, format, and just generally muck around with. Aside from that though, inconsequential.
- bayareaguy 19y agoI like YC's current look. Could CSS really improve it? Here's a suggestion. If you think the answer is yes, then how about posting a link to a site that could show us how and we'll up/down mod your post accordingly.
- rob 19y agoI am concerned that Hacker News doesn't even have a DOCTYPE in the source code.
- henryw 19y agowith the value added to us readers, i think we can overlook this issue and get back to coding. would you yell at your girlfriend for cooking you a nice dinner and putting the fork on the wrong side of the plate?
- mberning 19y agoWhat you can do is what matters most. Something works or it doesn't. How you do it is purely subjective.
- tzury 19y agogetting-things-right-vs-getting-things-done http://evalinux.wordpress.com/2008/01/02/getting-things-right-vs-getting-things-done/ http://evalinux.wordpress.com/2008/01/02/getting-things-righ...