Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

321–330 of 473 posts

Re: Hardest problem in computer science: centering things

#321

Earlier quoted context omitted.

Depends on who you want to be able to access your site. Not everyone had 10Mbps+

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.

Re: Hardest problem in computer science: centering things

#322

Earlier quoted context omitted.

Man... whole generations just straight up either do not realize, or have forgotten that early CSS revolved around creating documents, not apps, and that all of those design paradigms originated from typesetting. In the same way that one would float a figure to the left or right of lines of a paragraph, `float: left;` and `float: right;` allowed you to do the same. Open a textbook and look at lines of a paragraph flow…

Honestly, that itself sounds bad too. The concept of floating sounds like something invented back during manual typesetting or earlier. I think anyone ever trying to write a paper or book with images in it using tools like LaTeX knows how bad it is to let the tool position images for you. It's always wrong, and one of the first things you learn is how to pin the image in between the text lines/paragraphs you wanted i…

A lot could be said. If there's a mistake, it was the economy not providing sufficient resources to solve this problem well. There was certainly awareness of this topic and some attempts to address it (for example North, Stephen C. "Incremental layout in DynaDAG." International Symposium on Graph Drawing, Berlin Heidelberg, 1995, or North, Stephen C., and Gordon Woodhull. "Online hierarchical graph drawing." Graph Drawing: 9th International Symposium, GD 2001 Vienna, Austria, Springer Berlin Heidelberg, 2002.

Successful systems like Tom Sawyer Software or yWorks have dynamic or incremental layout features. The market of course strongly rewarded work on interactive systems like Visio that were well integrated into larger platforms.

Not sure who remembers but high performance incremental constraint-based layout was one of the computer science lights that failed in the 1980s and 90s but with so many fundamental advances in technology (processors, algorithms, solvers, software platforms) and new emphasis on language-based approaches (in part due to LLMs) there might be a better opportunity now.

Anyway it's a hard problem, it's not as if nobody was aware of it.

Re: Hardest problem in computer science: centering things

#323
post #161

Why is it that every other post that has to do with design has some weird graphical choices in it? I am talking about the bright yellow background.

It proves there are no depths to the arguments about good design, and what personal taste constitutes good design.

It's also why I enjoy being a backend engineer.

Action is truth, appearance is fickle.

Re: Hardest problem in computer science: centering things

#325

Earlier quoted context omitted.

Yes, and let’s not forget fallback fonts. So rules for each browser and OS and each font class and each layout (desktop, tablet, mobile). Probably on the order of 100 rules for a single style. Yeah, we’re just being lazy. We need sane font rendering in browsers that treat things like alignment in a way that we’d expect for the 99% case. If I say “center” it should just fucking center.

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 hacking on more shit for each website.

Re: Hardest problem in computer science: centering things

#326
post #126

Earlier quoted context omitted.

I’m not entirely sure I agree with you on this. It’s hard for me to say because I really like the imperfections in things I build, for the most part. Like I’ll full spartle a wall (not entirely sure if this is the correct English description) and I’ll intentionally leave the finish less than “perfect” because I think it adds a little soul to it that will make me happy down the years. Then you have things like floorin…

> You’re not going to ever build a perfect floor if you build it all the way to the wall. So what you do is that you leave a gap between the wall and the floor and you cover that gap up with wooden “footlists” (again not sure if that’s the correct English description). This gives you a “perfect” floor which aligns with everything in the room. Here in the US, it's called “baseboard”: https://www.google.com/images?q=ba…

And commonly, in the US, you'll see baseboards (3-4" tall) which were sloppily cut and then that was, in turn, covered up with a quarter-round moulding. If the floor and wall are installed properly, the quarter round shouldn't be necessary.

Re: Hardest problem in computer science: centering things

#329

Earlier quoted context omitted.

Nah, semantics are worthless. The whole semantic web idea never took off for good reasons, HTML5 semantic tags don't have any meaningful semantics and you can't even reliably remove boilerplate from HTML without ML pipelines (a basic use case you'd expect any "semantic" document format to nail easily). Then the invention of LLMs killed it twice over. HTML is a graphics rendering language in denial about its true natu…

I suggest you spend some time with a screen reader or have a look at the accessibility tab of you browser to get a feel of the worth of semantic web. It's true you won't ever have a perfect semantic representation of a page (and I have no idea how blind people manage those infinite scroller), but in my mind having or instead of still helps a lot on that aspect.

I use Shortcat all the time which relies heavily on the accessibility tree.

Screen readers / accessibility tools don't use the semantic web. The semantic web doesn't exist, it refers to the Tim Berners-Lee vision of documents being XML or RDF data structures with schemas, transformed into pixels using stylesheets and XSL:T. It never happened for various reasons.

Re: Hardest problem in computer science: centering things

#330

That bright yellow background imprinted my eyes for 5 minutes, there's other way to leave an impression than fucking up with my senses, like writing a clear concise article instead of a never ending list of examples interrupted with distracting fake mouse move. An horrible web experience through and through.

Fully agreed, it's an awful choice. I had to click the Reader View icon before I'd finished reading the first screen.

The mouse pointers are a prime example of "just because you can, doesn't mean you should".

Post reply on HN