4 ms·
I'm not the site owner, and I'm not a web developer. I'm a big iron programmer who writes algorithms and implements processes for dealing with specialist data.
by ColinWright 14y ago
I'm not the site owner, and I'm not a web developer. I'm a big iron programmer who writes algorithms and implements processes for dealing with specialist data. I've written HTML, but not since v2.0. I'm not up to speed with CSS or HTML5, although I've glanced over the specifications and have some idea of the concepts.
With that in mind ...
I'm always bewildered by people who ask this question. I don't understand what's wrong with using tables and center. No, it's not using the latest HTML5 standards, and it's not using bleeding-edge features, but
(a) it works
(b) it's fast
(c) it runs on both new and old browsers
(d) the HTML expresses the formatting intent
(e) in this context, separation of content from formatting is overkill.
So I'd be really interested to understand the alternate point of view. Apart from the obvious mistakes in the HTML, why is it regarded as bad practice?
Is it just because it's old?
- daleharvey 14y agoIts verbose, hard and slow to change, hard for end users to customise, works terribly in any other context than a desktop browser, plays terribly with all other web tooling. PG has his priorities (and limited time). I remember him stating in another thread that any time he spends improving this site were on trying to improve its content, not other relatively meaningless problems like its formatting. In the same circumstances I completely agree with his decision, but lets not pretend as font end code goes this is nothing else than a showcase of bad practices.
- ColinWright 14y agoWell, in order to help me (and no doubt others) to learn further, would you be able to produce what you consider as good html that produces a page that looks effectively the same? I'm specifically asking not for a redesign, I'm looking to be able to compare "good code" against "bad code" to produce this layout. I think that would be really useful - thanks. In particular, I don't understand: * It's verbose, I'd love to see how "modern" practices make it less verbose * hard and slow to change, Until I can see something you claim to be easy to change I can't assess this. * hard for end users to customise, How are end users going to customise it? It's a web page. * works terribly in any other context than a desktop browser, Actually it renders well on every browser I use, whereas most "modern" pages screwup royally on some of my browsers. That's one of the things I really don't understand. For reasons I won't go into, I use some really old browsers on some limited platforms. Frequently pages that are held up as examples of good design or good implementation render really badly, if at all. HN is one of the few sites I can browser on all my platforms, so I'd really like to see what you think would be better. * plays terribly with all other web tooling. I guess this is where my complete ignorance of modern web programming comes in, because I have no idea what this means. I appreciate your response, and look forward to learning more. I've wanted for some time to learn more about modern web programming, and despite several attempts I feel that it's just a foreign land. It would be great to get a real insight. Thanks.
- jmduke 14y ago> How are end users going to customise it? It's a web page. User-agent stylesheets, which play much nicer with CSS than HTML (<center> tags are evil.) > Actually it renders well on every browser I use, whereas most "modern" pages screwup royally on some of my browsers. That's one of the things I really don't understand. For reasons I won't go into, I use some really old browsers on some limited platforms. Frequently pages that are held up as examples of good design or good implementation render really badly, if at all. HN is one of the few sites I can browser on all my platforms, so I'd really like to see what you think would be better. HN renders the exact same on all three of the platforms I use -- Windows 7, iPad, and iPhone. This is not an inherently good thing, and it makes browsing a pain.
- codeka 14y ago> Well, in order to help me (and no doubt others) to learn further, would you be able to produce what you consider as good html that produces a page that looks effectively the same? I've actually considered writing a sort of "proxy" website for HN that just rewrites the HTML to work better on a phone, just for my own use. If I ever get around to it, I'll let you know :)
- rwos 14y agoI'm not the parent, but I do web development - here's how I understand it: > hard for end users to customise I think, he means that a css-based ("modern") solution would allow end-users to just swap the css (a feature most web-browsers have as a built-in) to change the site's appearance - whereas you cannot change the way a <table> looks, for example. That is, you can't easily make <table> columns appear below each other, for example. > works terribly in any other context than a desktop browser The parent probably means modern non-desktop web browsers, i.e. ones with javascript and media-query support. Using media queries would allow automatically changing the site's appearance to something more usable for small-screen devices (for example) - by using bigger buttons/links/up-vote-triangles or something like that. The problems you mentioned are orthogonal to that - mostly caused by devs that only target js-enabled modern browsers. That's bad, of course, but it's not part of "modern web development" per se - it's just bad web development. > plays terribly with all other web tooling If you use "modern" web-dev methods (that is, styling only per css), other (web-)services that display your site in different contexts (think google reader or desktop mail readers or something like that) can swap or remove the css and get the content (including semantics like "headline", "list" and so on) without the styling ("these are table columns", "this is centered"). In theory, at least. I don't understand the rest of the points either, to be honest. <center> and <table> are very compact, compared to equivalent HTML/CSS solutions - that's part of the reason why people keep using them.
- jerf 14y ago"Its verbose, hard and slow to change, hard for end users to customise, works terribly in any other context than a desktop browser, plays terribly with all other web tooling." [citation needed] x 4. This is a recitation of the propaganda, yes. However, propaganda is not a logical argument. What about "<center>" is verbose? Do you have a CSS solution that is actually shorter than "<center></center>", while also being good CSS (and not just using 1 character class names)? Do end users really have a problem customizing the center tag? How so? CSS and XPath do not particularly have a problem with it. I use this site on my 3DS sometimes and it seems to work reasonably well. What "web tooling" matters, and how does it interact with Arc so horribly? During the old CSS wars I sort of understood the argument for deprecating it, but with the way browser engines have been going, there's really no reason to pretend there's any reason to get rid of the element, because it's just one line in a definition file somewhere that specifies it as a block element with a certain default style.
- drivingmenuts 14y agoHTML is presentation and CSS is the design and one does not mix the two on a properly designed site. If they are independent, it become possible to change the look of the site, independent of the data presented. Yes, that means you use tables, for tabular data, but forums are not tabular data. They are more akin to lists, which have their own rules.
- jerf 14y agoYes, that's the propaganda. I don't think reality has worked out that way. At least, I've never seen a site get overhauled via CSS alone on anything other than demo sites designed for that explicit purpose. Since CSS now lets you override anything and turn tables into lists and lists into tables, it hardly matters any more, and the entire concept of "semantic" is just a sick joke unless the word "context" shows up somewhere, which it never seems to in these conversations, and in particular, hasn't got much place here either.
- Kerrick 14y agoI hate to bring that site up, but 4chan's recent overhaul was a move to HTML5 and CSS from table-based design for that very reason. HN Discussion on it: http://news.ycombinator.com/item?id=3902976 http://news.ycombinator.com/item?id=3902976
- codeka 14y agoThe main problem for me is it makes the site pretty painful to use on a mobile browser. With proper markup and good CSS, the site could easily be much more usable on a smaller screen.
- ColinWright 14y agoInteresting. It works fine for me on my mobile device, and on my netbook, whereas other modern mobile sites often don't.
- jmduke 14y agoWhat mobile device do you have? It's impossible to read on my iPhone.
- ColinWright 14y agoRenders perfectly well on my Blackberry (foist upon me by work)
- __chrismc 14y agoI wouldn't say it's impossible to read on my 4S, but it is certainly not "optimal", due to the table-based layout (with large margins). The page is zoomed out quite far when first loaded. Text is rendered pretty small, even when you double-tap to zoom in on the content "column". It's readable for me, but I still have pretty reasonable eye-sight. I can imagine it would be a lot harder if your eyes were even just slightly less capable than mine. As for the original question "why?" - my guess is because a) it works, and b) it's quick. Sometimes you need to be pragmatic about these things.
- Phlarp 14y agoDo people really read the desktop version on mobile? The hn.gethifi mobile site is excellent!
- codeka 14y agoIt "works", but not without copious zooming and scrolling. Clicking the vote buttons in particular is a kind of challenge I don't like subjecting myself to and I actually find I vote on comments much less frequently on my phone than on my desktop browser just because its such a pain. I know what you mean about many mobile sites since people often assume the only mobile devices are iPhones and Androids and nothing else, but that doesn't mean the way this site works is any better :)
- shpoonj 14y agoa. well... yeah, or it wouldn't be here b. not any faster than doing it without the deprecated and misused tags c. you'd need to be a developer who hadn't updated their browser in over five years for this to be a concern... at that point you should probably find a different line of work d. no, it doesn't, and this is the point. the data isn't tabular so it does not belong on a table e. whaaaaaaaaaaaat
- sergiotapia 14y agoI'm not going to regurgitate what's already said here: http://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html http://stackoverflow.com/questions/83073/why-not-use-tables-... --- The reason I even brought this up is because I wanted to create an extension for the site; but this terrible markup isn't going to make things easy. Plus it's heavy on my mobile phone because of all the tables.
- ColinWright 14y agoHere's the key: I wanted to create an extension for the site; I don't actually understand what this means. I'm coming to the conclusion that the people who actually know and understand modern web programming can't actually explain things to someone who is an experienced programmer, but not a web programmer. I've searched diligently, and I've wasted a huge amount of time, but I've never managed to find anything that explains WTF goes on in modern web programming and/or development. I've pretty much given up. It seems a completely closed shop.
- sergiotapia 14y agoYou have never used a web extension/addon? Are you browsing the web using Lynx? Stallman, is that you?
- ColinWright 14y agoCorrect, I have never used a web extension or addon. I use Konqueror 3.0.3 on KDE 3.0.3, I use Konqueror 2.0, I use Firefox 2.0.11, I use Firefox something or other than comes with Ubuntu 12, and another Firefox that comes with Ubuntu 11, I use the browser that comes on the Blackberry bold, I use my own web browser/fetch system on a machine that I built by hand, I use Chrome on Ubuntu 12, I use Chrome something on Windows XP, and I use Lynx. I have a complicated life that means I use embedded systems, systems I've built, systems I've rescued, and a more modern desktop development system. So, I don't spend a lot of time messing about with browser extensions or addons or other extras. It's not what I do. Yes, I move in different circles from you, and while I'd like to learn about modern web programming, and feel I'm probably capable, I've yet to find a decent introduction, tutorial, and reference. If you can offer any advice I'd be interested.
- donerKebab 14y agoIt's not because it's old. It's because it's semantically incorrect. It's because positioning is done in the html. It is generally considered a good thing to separate areas of concern. Content in one place, style in another.
- Johngibb 14y agoI think the question is _why_ is it important to be semantically correct, not do positioning in the html, and to separate areas of concern. Note - I agree with you, I'm just clarifying the question. I think the answer is really only two things: 1) Accessibility. A screen reader can probably work better with semantically valid markup. I've not much experience with these, but it's my assumption. 2) Ease of development when making changes. This one is purely for the developer, not the end user. It's probably true, but there are definitely cases where just throwing a table at the problem is simpler than CSS, especially for someone not up on HTML5. What else?
- napillo 14y agoI'll agree to that. If you aren't displaying tabular data in a table, you're doing it wrong. Tables are useful, and in 1996, that was the best way to get your elements where you wanted them, short of frameset. Still, this is not 1996, and CSS can be used for positioning.
- andrewgjohnson 14y agoa) Agree b) It's fast? More markup = faster? Definitely not the case c) You mention HTML5 & CSS3 which some browsers don't have full support for but considering none of those features would be required for HN I don't understand this point at all. How far back to you need to go to find a browser that doesn't support "background-color"? d) Why is this a pro? e) What context would it not be considered overkill? Completely arbitrary decision.
- capsule_toy 14y agoThe main reason I avoid tables is because of my previous experience. Tables, and especially nested tables that wrap the entire site, would be noticeably slower when changing styles dynamically. For example, changing the positioning of an element on hover when the element is deeply nested in divs. The second I removed the tables, this was calculated much faster. This was about five years ago so I have no idea if this performance concern exists any more. Separation of concerns is a design choice. I'm not sure what context you meant, but if you find that it's overkill, you can make that design choice that it's unnecessary. In general, I find separating these concerns leads to cleaner and more understandable code, but I can certainly imagine situations where your argument can be made, especially on sites that are simpler. Some people do believe quite a bit in purity and believe the markup should just describe the data. I agree that it's nice but doesn't always work out in practice. This can get taken too far. For example, I've seen complex workarounds for centering vertical alignment when they could have just thrown a table, but they wouldn't do it because a table is for tabular data. In this case, I felt that the table would have been easier to read and understand. Again, this is my preference and others may disagree. TL;DR; - It depends. And performance issues back in the day.
- Francisc 14y agoYup, you're definitely not a web developer.
- Charles__L 14y agoIt's basically OK to keep older styles, but: "(a) it works" It does work, but when someone tries to reverse engineer the code( say to write a spider ) its difficult to read. "(b) it's fast" Thats probably true for sections of the html, but nested tables are not the fast. "(c) it runs on both new and old browsers" But nested tables aren't required in older browsers, they work with divs. Besides, who uses a browser that is older than 2000? "(e) in this context, seperation of content from formatting is overkill" Why? It makes quick changes much easier. I was fiddling with HN on firebug and had a hard time finding where everything was. There were tons of in-line styles that kept overriding the basic styles from the CSS file. It's always better to change things in the CSS file, because it makes changes easier later. I'm not saying for people to never use tables. But I think they should be used for what they were originally made for: tabular data. Some people go overkill trying not to use tables and that's not a good idea. Tables work really well when they are used right.