Lurker News
Back to discussion

Comment by petercooper

petercooper5 replies#
hn's nested threads built with are so simple that they're brilliant. No horizontal scrolling, no flipping between pages, just click "reply" and you're good to go.

I don't think s should get undue praise. With s, the code would be easier to read mechanically (for manipulation with Greasemonkey, say) and even though there'd be a little more CSS, the page weight might be reduced a little (I'd have to make a mockup to be sure ;-))

omouse1 reply#
^^ THIS. I love it when sites use DIVs because it makes much much easier to chop them up and display them the way I want to by using Stylish or GreaseMonkey. The browser is a customizable viewer...your stylesheet is just a suggestion.
petercooper#
If you use Selector Gadget - http://www.selectorgadget.com/ - it's possible to divine pretty horrible and complex CSS and XPath matches for things on Hacker News but.. they're far from entirely reliable. A lot of ugly TABLE TD:nth-child(5) stuff..
coderdude4 replies#
I disagree. Tables are still the most reliable way to display content under nearly all circumstances (maybe less so on mobiles, but definitely on the desktop). They've been stable for years and years. I went through the hardcore standards phase where I thought it would be the death of my soul if I ever went back to using tables for layout, but then I read a great article (wish I had the link) that struck a chord with me. It said you don't have to avoid tables for certain small situations where it can save you a ton of time and a few headaches. I would never suggest doing a whole layout in tables, but I think the comments on HN are a good example of something that would have been a pain in the ass to get right across all browsers. Just use tables for layout if it actually makes sense and even then, ever so sparingly.
barmstrong1 reply#
Yeah this could quickly devolve into a flame about divs vs tables. But divs I always saw as a step backwards in one aspect: programmer ease of use. In divs you have to spend time thinking about "float drop", doing math in your head, and getting all the columns to have the same height - things which "just work" in tables. It still surprises me sometimes how quickly they were adopted.
petercooper#
But divs I always saw as a step backwards in one aspect: programmer ease of use.

It's always a lot easier at first to overlook structure in your app/code/whatever. It's when you or others come to work with your code or extend it in some way (with Greasemonkey, say) that all the extra work comes along.
If you have to "spend time thinking about" writing tests, it takes longer to build the prototype of your software but.. that's not a particularly good rationale for not using tests (though it is still a rationale, of course). Same goes for semantic markup in my book.

_pius1 reply#
Tables are still the most reliable way to display content under nearly all circumstances (maybe less so on mobiles, but definitely on the desktop).

I don't think that's been true for several years.

coderdude4 replies#
Internet Explorer pretty much guarantees that my statement is true.

Continue this thread — 4 replies

random42#
>. It said you don't have to avoid tables for certain small situations where it can save you a ton of time and a few headaches.

I am not a front end developer, but I agree to the philosophy to an extent in terms of generic software development.
As software developers, our job is not to thrive for the perfect solution, but writing maintainable, code that we ship. I understand that many people (probably not HN users) take "real artists ship", as an excuse to put ugly unmanageable "hack", which I am not supporting either (infact I think I would be one of the last guys to compromise of code quality), but truth of the matter is, we live in an non-ideal-finite-time-full-of-deadline world, and as every thing has a cost-to-benefit ratio (short and long term). I think as software developers, its a part of out job to judge that cost-to-benefit ratio and if the cost starts to become much for the benefit offered, its time to rethink about software puritanism.

subbu#
's might make sense from a purist's point of view or even from a experienced web dev's point of view. But I think, hn's changes have been based on pragmatism. So tables could be one of that. I remember pg saying he left out search feature saying google does a good job of that.
mshafrir1 reply#
Don't unordered lists make more sense than divs in this case?
spc4761 reply#
dl might make more sense here---meta information about the post in a dt and the post itself in a dd.
mshafrir#
Although I don't think a post would be considered the term and the responses the definition.
ronnier#
I actually think the best way to display these types of comments is with nested UL/LI's. It makes it really easy to call a recursive function to write out the comments then adjust the indentation with CSS. For my mobile HN site, I do just that. From there, it was trivial to add in the ability to collapse and expand comments. For example, view this page through my reader (It's meant for mobile phones):

http://toadjaw.com/hn/comments/1398250