Hacker News new | ask | show | jobs
by eska 859 days ago
in my experience many of the people who wax poetic about just using tables and/or complain about how CSS is limiting and confusing...never actually put in much of an effort to learn how it works

As somebody who was actually there back then your opinion reads as arrogant and condescending. Do you really think the entire industry just did it wrong for decades? That people did not frantically search for an easy solution for this silly problem they faced constantly? You'd do well to learn to be more humble.

4 comments

Having also been in this industry for two decades, you haven’t noticed the amount of wrongheaded groupthink that leads the entire industry astray with flashy marketing for the latest ill-conceived toy for both management and engineers alike?
Yeah, this industry seems particularly prone to it. Do you not remember the 90s and early 00s, where most of the industry was utterly convinced you needed unreadably small body copy and splash pages? Or how about CSS in general? I must have heard “you can only use CSS for boxy designs” a thousand times before Dave Shea got fed up and created CSS Zen Garden to conclusively prove them wrong. The number of times I’ve seen the majority of the industry believe something completely dumb and then figure it out 5–10 years later is insane.
I have, but in this case it was truly necessary to do all the disgusting stuff like using Javascript to center stuff, because the content width had to be determined in hindsight. All suggestions in the article use features that came out in the late 2010s that solved this.
The entire industry did, in fact, do it wrong for decades.

The problem was never that CSS - a DSL that exposed more of the browser's layout and painting engine than HTML did - was somehow less capable than HTML alone at implementing the same design.

The actual problem was that the requirements of designing for the web changed very rapidly. Take GP's example of text centred in a 600px yellow square; again it's not that it was soooo hard to achieve that specific layout with CSS. It was that they were trying to accomplish layouts a lot more complicated than that, often without breaking those layouts down well enough to be expressed in terms of the available layout algorithms. The longterm solution to this was of course for browsers to provide implementations of more advanced algorithms (like flex and grid) to match more advanced layout requirements, but that process was dragged out for far too long and eventually landed in a far too fragmented manner - a massive mistake.

And on top of that, it's not as if the existing layout algorithms were particularly incapable; on the contrary, they are well documented and you can get very far with them alone. So many questions ("how do you center a div??", "where are my margins??", "why isn't z-index working??") have answers that are quite apparent if you're familiar with the spec and thus understand what the browser is actually doing when it lays out your elements. But how many devs even know that e.g. stacking contexts exist, to talk of when they are created?

It's not as if it's even their fault, it's yet another thing that basically the entire industry did wrong for years. How many web design/frontend tutorials really explain anything about the CSS spec or about how UI rendering works in general, as opposed to just shoving arcane styling incantations at learners to cram? It's a failing of the industry that even today you have to go quite a bit off the beaten path to actually learn CSS (and HTML itself, while we're at it). Imagine if we taught any other language in the same haphazard manner! Just because they aren't technically programming languages doesn't mean that they're not worth proper instruction.

If you look at any of the suggestions in the article, each uses at least one feature that came out in the late 2010s. Add a couple of years until initial bugs were fixed (which were there), and until browser adoption is high enough that older browsers can be ignored.

Back then I could whip up a dozen centering solutions, but not a single one that worked across all browsers in all cases. Tables just worked.

You're so wrong about the history that it makes me assume that you started webdev after this compatibility mess was fixed. It was truly disgusting. If anyone had found a solution back then everyone would have slurped it up immediately.

Ha, ya you're right. My memory on table-cell was fuzzy and didn't bother looking into before making some other responses. IE 6 and 7 had no support for it and Firefox had partial support until 2008. I'm just looking at caniuse, of course, I don't remember what Netscape supported.
I see overlapping text among a smorgasbord of other mistakes on the New York Times front page. Presumably they have the resources to hire top designers from this “industry”. No, I have no problem imagining that they did things wrong for decades.
I agree with most of your comment but my sibling commenter isn't wrong. I certainly think we all do do things wrong. I mean, someone put JavaScript on the server after all ;)