Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

331–340 of 473 posts

Re: Hardest problem in computer science: centering things

#331

Earlier quoted context omitted.

You don't need 10Mbps to download a 30kB font file. And if you're really targeting people that have trouble loading such a font file, then you have much, much bigger problems than centering things (you basically cannot put any image on your website).

A 30kb font file kinda website is probably gonna serve a 2Mb all up web page which at 100kbps is a slow experience.

> A 30kb font file kinda website is probably gonna serve a 2Mb all up web page

Where's that ratio coming from? Shipping fonts is just good practice when you want your website to look consistently on all platform, it doesn't mean anything else about how the website is made.

Also, 100kbps is a very slow connection, it's 2 orders of magnitude less than the 10Mbps you talked about earlier, and when you have this kind of very poor connection everything is kind of slow anyway (even the very barebone HN's front page is 120kb!).

Re: Hardest problem in computer science: centering things

#332

Earlier quoted context omitted.

Fallback fonts are a legacy of the past though, in an era where everybody ships at least hundred of kilobytes of JS and images (when it's not tens of megabytes, but this is another topic…) there's no good reason to specify a font and hope it will be found on the customer's OS: ship the font you're using.

No thanks, I don't want your shitty font file that only looks ok on whatever system you testet. All websites should use the system font for body text. The only problems is that a) the default browser font is usually some ugly shit instead of the system font and b) there is no way to specify size in a way that different fonts will actually be the same size. Both of these need to be fixed in the browser instead of hack…

> No thanks, I don't want your shitty font file that only looks ok on whatever system you testet.

Why would it looks bad elsewhere?

> All websites should use the system font for body text.

Wait what? There are very different requirements when it comes to reading system widgets and actual text! (like we don't use the same kind font for code and prose).

Re: Hardest problem in computer science: centering things

#333
post #273

Earlier quoted context omitted.

For me, it's the all-lowercase style of some of the current in-vogue AI leaders like Sam Altman that drives me crazy. Is your shift key... broken? No? Use it please.

97% of people don't use a shift key for capitals now it seems

98% don’t use periods. ;)

Re: Hardest problem in computer science: centering things

#335

Earlier quoted context omitted.

It is a weird myth that CSS somehow discourages tables. CSS have supported styling html tables and ‘display:table’ (allowing a table-like layout without html-tables) for 25 years. Float and clear was grandfathered into CSS since they were added to HTML by Netscape. They are fine for their intended purpose: placing images in a text and have the text flow around. Other positioning systems you mention does not solve the…

> It is a weird myth that CSS somehow discourages tables. CSS have supported styling html tables and ‘display:table’ (allowing a table-like layout without html-tables) for 25 years. Not a myth in any way shape or form. Tables for layout (not tables in general) were discouraged with various arguments in favor of "float/clear", even decades before a sane substitute (grid/flex) was available. > Other positioning systems…

> Tables for layout (not tables in general) were discouraged with various arguments in favor of "float/clear"

Table markup was discouraged. There’s nothing intrinsically wrong with display:table from a CSS/semantic markup evangelist’s point of view, it’s just awkward to use, requires you to arrange and order your markup just so (sometimes contrary to semantics), and was rarely mentioned in the days of float/clear because IE screwed it up in various ways (that were more difficult to fix than those for floats). It works reliably now, but as far as laying out the page goes the requirements for ordering the markup will probably be incompatible between desktop and mobile. For insides of buttons and such, though, go nuts.

Re: Hardest problem in computer science: centering things

#337

Earlier quoted context omitted.

> I mean, semantics are also good! Yes, CSS grids are a lot like tables in some ways, but not having to add 25% more DOM elements to fake a table layout (display: table/table-row/table-cell; that's 3 divs for one row!) is also a thing to be celebrated. Semantics in the context of CSS is a stupid idea web designers came up with. They heard the concept of "semantic", and had to fit it in, to appear smart. Should have a…

Yeah, it's a joke. You can't take "HTML semantics" seriously when you often depend on actual element position IN THE HTML CODE to make things work, specially when modern web design demands elements to just JUMP AROUND all over the page when the width changes. If they really wanted semantics you would think there would be actual support for that. By the way, I've asked this question here some other day, but nobody has…

There's not much software that takes semantic HTML as input, because barely anyone writes semantically-valid HTML. It's a vicious cycle. (Look upon the parsing rules for a high-quality screen reader, and weep.)

No point making a semantic web browser before we get a semantic WYSIWYM HTML editor. Maybe those could be the same program, like in olden times?

Re: Hardest problem in computer science: centering things

#339

No, that's just in web development. Otherwise things are pretty trivial to keep centered. HTML/CSS somehow dropped the ball so hard, it became lobsided and will never center itself correctly. But even then: just use grid. It works.

The article uses screenshots from apps and operating systems’ interfaces though.

Re: Hardest problem in computer science: centering things

#340

Earlier quoted context omitted.

CSS never recommended float/clear as an alternative to table-based layout. CSS had ‘display:table’ for when you needed a tabular layout without the semantic baggage of the table-tag.

CSS is just a language + words of paper spec. CSS, as in "CSS evangelists", influential web designers, guidelines in web development resources, books, and so on, recommended and advocated for the use of clear/float. You might not have been there, but float layout was a big thing back then, and everybody was guilt-pressured to use that - neither tables, nor "display: table" (which was used by some, but also discourage…

I never saw anybody discourage people from using display: table. The reason why nobody used it was because Internet Explorer 6 didn’t support it.
Post reply on HN