Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

451–460 of 473 posts

Re: Hardest problem in computer science: centering things

#451
The post starts from "funny" statement. "It has never been simpler" and then two examples follow -- one for grid, and one for flex. Both are broken. Yes, I know, they should work and they probably were intended to work by design, however CSS design levels are so low, that centering via simply commanding "center" is not reliable. Hand up if you know when it fails (in 100% legit scenario) and how to "fix" it :-).

Re: Hardest problem in computer science: centering things

#452
post #293

What really drives me insane is the animated mouse cursors on the left and right that sometimes move and sometimes don't in this article..

It's other peoples mouse cursor.

Thanks for the clarification. Still a rather horrifying effect for me given that I was trying to take in the content of the article and not the latency-ridden odd movements of other people's cursors, am I missing something (more!) here in terms of the why?

Re: Hardest problem in computer science: centering things

#453

Earlier quoted context omitted.

Come on, there are so many native cross-platform solutions which are easy to go and much less bloated than web engine, e.g. Qt/GTK+/wxWidgets/Xamarin/etc.

All of those would require an user to download and install something, no? How do you push updates?

Yes, this is how classic software works. It can download updates in the background, just like e.g. web browsers do. It will be more performant than web apps.

Re: Hardest problem in computer science: centering things

#454
post #128
post #49

Surely we all know at this point that the two hardest things in programming are: naming things, threading, and off-by-one errors.

“Naming things” can’t be listed first, the joke doesn’t work if you put naming things first.

Enlighten me please, sincerely. I’m apparently too thick to understand.

Re: Hardest problem in computer science: centering things

#455
post #119

Earlier quoted context omitted.

Jup. Somw people like to think centering things is taking the bounding box of the visible pixel and centering the center of the bounding box. But some letters have more pixels in one half or the other, so that would leave you with more whitespace one one or the other side. That means despite being metrically centered it still doesn't look optically centered. I guess one could devise algorithms for that, but I haven't…

The problem with your brain and your eyes are that they aren't available after the user picks their preferred font or for user-generated content or probably not after the text had been translated.

We can safely assume at that point the GUI may not look exactly as intended either way.

Re: Hardest problem in computer science: centering things

#456

Earlier quoted context omitted.

All of those would require an user to download and install something, no? How do you push updates?

Yes, this is how classic software works. It can download updates in the background, just like e.g. web browsers do. It will be more performant than web apps.

That's quite a lot of extra code to write. Any app you want to share this way now needs to think about networking, self updating, version management etc.

Re: Hardest problem in computer science: centering things

#457
post #432

Earlier quoted context omitted.

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…

> everybody was guilt-pressured What, no? I did a lot of web development in those days and read a lot of blogs. You just needed to filter out anyone who was obviously over-opinionated and lacked any nuance. Most pragmatic people used tables and didn't feel guilty about it. If you delivered working software with a decent UX, why on earth would you care what some shouty internet person said??

Many public institutions was mandated to follow the WCAG (Web Content Accessibulity Guidelies) which recommend against tables used purely for layout.

So it it not really about vague “guilt-pressure”, it is just that many web developers had to follow WCAG as part of their job.

Re: Hardest problem in computer science: centering things

#458

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…

Nobody was guilt-pressured into using floats. You might say some were guilt-pressured into writing accessible web sites but that is a significant destinction. Many public/government web sites were mandated by law to be accessible, so many developers had to write accessible html whether they liked it or not.

Of course for your personal Tranformers fan site you can use html tables to your hearts desire. Nobody is likely to complain.

But most web-design focused media is targeted professionals for whom it is a necesssary skill to be able to design pages which look good for most users and is accessible. During the dark age of IE6 it was necessary for developers to know and use a large array of hacks (including the abuse of floats) to achive this.

Re: Hardest problem in computer science: centering things

#459

Earlier quoted context omitted.

The grocer's apostrophe (which I will argue should be called the grocers'(1) apostrophe, since there are many offending grocers) is the bane of my existence (1) My phone absolutely tried to correct that back to "grocer's"

Maybe it should be the grocer's' apostrophe, since there are many offending grocer's.

Aaaagh, make it stop!

Re: Hardest problem in computer science: centering things

#460
post #432

Earlier quoted context omitted.

> everybody was guilt-pressured What, no? I did a lot of web development in those days and read a lot of blogs. You just needed to filter out anyone who was obviously over-opinionated and lacked any nuance. Most pragmatic people used tables and didn't feel guilty about it. If you delivered working software with a decent UX, why on earth would you care what some shouty internet person said??

Many public institutions was mandated to follow the WCAG (Web Content Accessibulity Guidelies) which recommend against tables used purely for layout. So it it not really about vague “guilt-pressure”, it is just that many web developers had to follow WCAG as part of their job.

Oof - I didn't know that. Kind of a weird requirement, were/are screen readers rendered so ineffective by the content being in a table as opposed to in divs?
Post reply on HN