
Ask HN: Why does this site use center and table tags? - sergiotapia
I'm curious as to why a website made for developers by developers uses such bad practices? Table usage has it's merits but while reading the markup for the site I got a real 1999 vibe.<p>Is it because of a "if it ain't broke don't fix it" mentality?<p>Maybe it's just plain "who cares?"
======
ColinWright
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?

~~~
codeka
The 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
Interesting. It works fine for me on my mobile device, and on my netbook,
whereas other modern mobile sites often don't.

~~~
jmduke
What mobile device do you have? It's impossible to read on my iPhone.

~~~
__chrismc
I 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.

------
jmduke
Regardless of the answer, I have a very hard time believing that, if shown a
random site also using <center> tags and a table layout, HN commenters would
be as defensive and accepting of the usage.

------
polyfractal
The real answer is probably "PG doesn't give a shit".

Right or wrong, there are many things about HN that are neglected. Layout is
notoriously one of them. Expiring links is another.

PG either doesn't have time, doesn't care enough to change it or HN is written
in a way where changing it would be a big project.

Probably all three. Crossing my fingers that this post doesn't raise the ire
of moderators.

------
noblethrasher
Part of the argument for designing with web standards (i.e. using semantically
appropriate tags) is that it makes things more maintainable. But this only
applies if you're coding in (X)HTML. For this site, pg codes almost
exclusively in Arc so he only has to worry about keeping that code
maintainable. In general, you should only worry about the source language, not
the object code it spits out.

The other part of the argument relates to accessibility and to my knowledge
the latest accessibility tech can handle "messy markup" just fine.

------
kemiller
Pg has gone on record (one of his essays - I'm mobile or I'd find it for you)
as preferring table based layout for his own projects because it's easier to
understand and hack. The HTML layout in arc is thus table based, and hn is
written in arc. So there you have it.

~~~
sergiotapia
>because it's easier to understand and hack

Wow, I never knew people actually thought it was easier. If using a table
based layout you have to type many many more characters and keep a mental log
of what's in where.

~~~
ColinWright

        If using a table based layout you have to type
        many many more characters and keep a mental
        log of what's in where.
    

Not when generating HTML via a program. It's trivial to generate complex
recursive nested table layouts that reflect/mirror the structure of the
underlying data.

------
digeridoo
I used to believe in <div>, but nowadays I just believe in whatever works. I
haven't noticed any rendering problems on HN, so I'm not sure what the problem
is.

------
crazygringo
Probably for the same reason the site has terrible graphic design, usability,
and discoverability.

(The gray in the text of the submission above is so light to be practically
unreadable, can't undo accidental upvote/downvote, can't collapse threads,
hidden URL's like /best that don't have links to them, etc., etc., etc.)

Because it feels like it was hacked together in a weekend and never touched
again.

Thank God the content is better than anywhere else, which makes up for it all!
:)

~~~
sergiotapia
I agree on the content, it has a lot of interesting things directly related to
my profession. :)

------
debaserab2
Dare I say that many HN readers (myself included) enjoy HN also because of
it's "vintage" look-and-feel. Yes, it does hearken back to the
AngelFire/Geocities days. It feels like a calling back to the time of some of
the web's first innovations.

For some, I think the internet has achieved a mature enough status that there
is outdated, replaced technology that some of us miss, even if we understand
it was replaced for very good reasons.

------
leonp
You could keep the 1999 vibe with CSS.

Are we having to explain why we don't use tables for layout in 2012!?

OK. Lots of reasons:

i) they create complicated HTML because presentation and meaning aren't
separated. This makes it hard to manage if you want to make a layout change,
or someone else needs to work on the site. ii) because content and its
presentation aren't separated the layout isn't very flexible. It won't scale
to fit on a mobile phone, for example. If the content was separated from its
presentation you could feed devices the same HTML and take care of the
presentation using CSS media queries. iii) because you use tables for layout
rather than their intended purpose (to tabulate data) the site is inaccessible
to users who are using a screen reader iv) using center tags is inefficient.
Using .class-name {text-align: center;} is hardly difficult and saves you from
trawling through your HTML should you want to get rid of the centring.

Isn't that enough?

------
DenisM
Because it works just fine, that would be my guess.

------
Tim_M
This compatibility of HN is far superior than both of reddit's mobile
versions. Please don't fix what isn't broke

------
devnill
This site is a bad example but tables aren't inherently bad. For tabular data
or charts they are just fine, but should not be used as a tool for layout.

~~~
donerKebab
That's just the point. Using tables for layout is what's causing the 1999
vibe.

------
Nikkki
It works! ;)

------
franzus
I guess it's because they work.

