

Ask YC: Why is YC's layout table based? - german

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.
======
run4yourlives
Most 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.

------
samson
I 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
CSS 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
... Until you realize that your fancy CSS doesn't display properly in IE6.

~~~
run4yourlives
Which, on a site like this, can be safely ignored! :)

~~~
palish
So you admit that fancy CSS for mainstream sites is generally a huge time
sink?

~~~
run4yourlives
No, 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.

------
mrtron
_smacks head_

Not this again...

The answer being who gives a shit? Does it look fine in most browsers?

~~~
run4yourlives
>The answer being who gives a shit?

As a web developer, you should. It will save you work in the long run (see
below).

As a hacker, you should, the same way you care about the beauty of readable
code in any other language.

As a business owner, you should, because it will save you money, in bandwidth
costs, future maintenance, training etc etc.

>Does it look fine in most browsers?

It looks fine in most browsers because the browser decided to make it look
fine. That doesn't mean that it'll look fine in the browser everyone is using
tomorrow. That means more work for you down the road, for no particular
reason.

Do I care about it? No, not really. But I do get a little annoyed at hackers
that concern themselves with code elegance in every language except HTML.

~~~
imsteve
> It will save you work in the long run

That's the biggest lie of them all. And maintenance? No one does that, they do
re-writes. How many hours have I wasted on this joke of not using tables?

~~~
run4yourlives
Have you ever operated a website with over a hundred pages? Just curious.

And as far as hours wasted, having coded both ways, and originally viewing css
as stupid and more work, I can now code a website in half the time using it
than tables.

In fact, when I'm just hacking something quick, it's great not to bother with
any layout at all and just come back to it when I have the time. You can't do
that with tables.

~~~
mrtron
I was a lead developer on a massive website...

If you are a programmer on a large site you won't touch the design. It will be
done by a skilled designer, or designing firm. You won't care how its done
whatsoever.

There is a lot more to say here...but basically you won't touch the design. Or
want to. Or care how its done :)

~~~
run4yourlives
Which is why you shouldn't be using HTML to "present" data. You do exactly
this when you attempt to use tables for things other than tabular data.

------
brett
PG might tell you it's because html is object code:
<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
You'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
Tables 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
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.

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
> 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. :)

------
divia
This 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>

~~~
ayc
That 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
How old is your computer? I've found news.yc load times are close to instant.

~~~
mrtron
Haha...I can imagine its a quad core, 4 gigs of ram and running vista.

:)

~~~
ayc
Right!

------
ashu
CSS 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
I 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
>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
I'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
The 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.

~~~
palish
I don't follow. At any instant in time, every element on a webpage has a well-
formed width. So why can't a child be centered, using that width?

~~~
run4yourlives
>At any instant in time, every element on a webpage has a well-formed width.

That's not exactly true. Every _block element_ has a width, but inline objects
do not. Furthermore, some block elements may have fixed widths, while others
may be designed to take up as little as they require.

The "center" attribute that you describe would run counter to the visual
formatting model of the standard that is in place to support a number of other
things. That would mean that its behaviour would be next to impossible to
design around if you were trying to account for all of your users screen sizes
at the same time.

See here: <http://www.w3.org/TR/REC-CSS2/visuren.html#containing-block>

~~~
palish
_That would mean that its behaviour would be next to impossible to design
around if you were trying to account for all of your users screen sizes at the
same time._

See, there's where we differ. I'd like to easily design a webpage that renders
fine on 90% of my user's screens. I'd bet 90% of my users will be using
personal computers, and use a resolution between 800x600 and 1920x1200. Want
to look at my page on your non-iPhone? I'd love to introduce you to the
_m.mypage.com_ section of my site.

Something like "Center a child relative to a parent" isn't hard to do (we do
it at work for our video game GUI), and it really seems like a few
architecture astronauts got ahold of the CSS standards to cause these API
usability problems.

Also, arguments like "You can't do that simple thing because.." are starting
to sound like the arguments C++ pundits use to justify its monstrous
complexity compared to C.

~~~
run4yourlives
I never said you couldn't do it, you just can't do it the way you prefer:

parent {}

child{ margin-left: auto; margin-right: auto; width: 100px; }

~~~
palish
My question is simply, what's the reasoning behind my inability to type:

    
    
      child{ center: horizontal; }
    

That would be very newcomer-friendly. Possibly naive, but I'm interested to
know why.

~~~
run4yourlives
1\. center to what?

1a. child is 0px wide.

2\. semantics: You're basically saying "Why isn't language x exactly like
language y/how I want it to be?"

3\. margin is what you're adjusting, so saying margin-auto makes sense.

4\. Layers and layering are an important aspect of CSS, you've just broken all
of them.

~~~
euccastro
This is what comes to mind to me, a CSS ignorant:

1\. To the parent, the width of which is known by the layout code of the
browser at any moment at 'runtime'.

1a. Fair enough, then it won't show up. But it will not-be-there centered,
goddammit!! >:)

2\. Which is a very fair question, and how languages get better.

3\. That is one way to look at it, the one the language seems to force into
you, and apparently it's the least intuitive.

4\. If you can get an exactly equivalent effect with other expression, how
come you can't have "center horizontally" just become an
alias/shortcut/abstraction for that, if newbies expect it?

Then again, this is only an issue for hand-coded CSS. If you use your HTML/CSS
as object code, this is easy enough to abstract in your generating code.

~~~
palish
_If you use your HTML/CSS as object code, this is easy enough to abstract in
your generating code._

Bingo! And that's one reason Arc is pretty exciting. I'll be able to do the
equivalent of center: horizontal, and the details can be abstracted.

~~~
euccastro
What makes you think Arc will improve on other Lisps in this respect?

~~~
Nicolay77
Hype.

------
rugoso
LOL, this is always one o my favorite insults, "he uses tables in his html"

~~~
sbraford
along with "i heard he produces invalid markup" (cue beavis & butthead laugh)

------
pg
Because the data is tabular?

~~~
run4yourlives
Um, 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.

~~~
pg
There 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
Well, 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.

~~~
pg
<http://en.wikipedia.org/wiki/Degeneracy_%28mathematics%29>

_HTML w/ CSS is actually easier to use_

You just don't seem to get that I don't use html. I generate it. Your argument
is like saying it's easier to write programs in old-style instruction sets
than RISC ones. Sure, but the best approach of all is to write in neither, and
instead have a program generate it. Then it doesn't matter which you use.

Complaining that the html source of a software-generated site is ugly is like
complaining that the code generated by the compiler of a high level language
is ugly. _Of course_ it's ugly; that's the whole point of high level
languages.

~~~
dcurtis
I don't get it. Just because it's generated by Arc doesn't mean it has to:

1\. Ignore web standards, 2\. Forgo readability, or 3\. Make bloated code.

I mean, look at the source of hacker news. Its just not elegant. Whether or
not you believe it should be, HTML/CSS was designed to be coded a certain way
and browsers expect that format. Why change it and suggedt that you're turning
HTML into something it isn't ?

~~~
pg
1\. How is using tables ignoring web standards?

2\. Html is object code. What matters is the readability of the source code
that generates it. Worrying about the readability of the output of a compiler
is akin to premature optimization.

3\. The front page of News.YC is 30k. If you think that's bloated, I hope you
don't visit sites that contain images.

Do you understand what I mean about the distinction between source and object
code? Saying that html ought to be elegant implies that you don't. As a rule,
the more elegant the language, the less elegant its object code is, because
the further removed its concepts are from the primitive concepts used by a
compiler.

~~~
run4yourlives
1\. <http://www.w3.org/TR/WCAG10-CORE-TECHS/#structure> It most certainly
ignores accessibility standards; also the spirit of all the other W3C
standards.

2\. I guess we know where you stand on the semantic web, don't we! :-)
(<http://en.wikipedia.org/wiki/Semantic_Web>)

3\. It's your bandwidth money. I'm not paying for it. (Of course, I would
disagree with the GP that HN is bloated)

~~~
pg
That document you link to isn't part of the HTML standard. It seems to be an
additional document from the W3C outlining how they'd like people to behave.
Conforming to software standards is one thing; you have to do that to make
programs work together. But complying with the W3C's wishes on how the web
ought to be used is a very different matter. I feel like doing exactly what
the W3C says on broader questions is not merely optional, but probably a
mistake, considering the people who make it up. It would be like running your
company according to a list of "best practices" compiled by a committee at
General Motors.

------
ivan
Because you should read news not the source code.

------
bayareaguy
I 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.

------
juanpablo
I think because it's easier... for him. I don't like it either though.

------
icky
Because it's Hacker News, not Designer Gallery.

------
tzury
getting-things-right-vs-getting-things-done
[http://evalinux.wordpress.com/2008/01/02/getting-things-
righ...](http://evalinux.wordpress.com/2008/01/02/getting-things-right-vs-
getting-things-done/)

------
rob
I am concerned that Hacker News doesn't even have a DOCTYPE in the source
code.

------
mberning
What you can do is what matters most. Something works or it doesn't. How you
do it is purely subjective.

------
henryw
with 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?

