Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

131–140 of 473 posts

Re: Hardest problem in computer science: centering things

#131
post #7

> That’s exactly why people love web programming so much. There’s always a challenge. LOL, these examples are exactly why I got out of web programming. Thankfully I never had to deal with any of the modern frameworks. I was getting hot flashes just scrolling through this page.

That was sarcasm, I think.

Re: Hardest problem in computer science: centering things

#134
what the heck is up with all those mouse cursors on this page - is it showing what everyone is looking at? why would I care?!?

The hardest problem in this article is actually reading it because somebody's cursor is sitting in the way.

Or is this just a bug in FF on this site?!?

Re: Hardest problem in computer science: centering things

#135
post #9

A designer once advised me to align an icon with the "typographical center of gravity" - as in, of the "ink". This would make the location of an icon next to text depend on the text itself, not just the font. Obviously, we compromised in practice :)

It's technically possible (although infeasible) with current web api though. You can draw texts to canvas, sample it, get the pixel value and find the true center yourself. But web also never guarantee that text on canvas is as the same as the one you see visually, so you can only find it out one by one.

Re: Hardest problem in computer science: centering things

#136

what the heck is up with all those mouse cursors on this page - is it showing what everyone is looking at? why would I care?!? The hardest problem in this article is actually reading it because somebody's cursor is sitting in the way. Or is this just a bug in FF on this site?!?

April fool prank, probably.

Re: Hardest problem in computer science: centering things

#137

Earlier quoted context omitted.

I’ve noticed these things all my life. Even as a young child I would point such things out and others would have trouble seeing it. Once I was diagnosed with autism, this tendency of mine made a lot more sense. I’m curious if other people detect interrupted or irregular patterns so readily. It’s like there’s a part of my brain just looking for anomalies and I can’t turn it off.

I have this with spelling. Even a fractional glance at a poster/billboard/sign, without focusing my eyes on it, and certainly without reading a single word ... any misspelled word triggers a flag in my brain sort of "pinging" me with the precise location of the misspelled word.

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"

Re: Hardest problem in computer science: centering things

#138
post #28

Earlier quoted context omitted.

There is challenging for the wrong reasons then there is challenging for the right reasons. You will want to make sure you work on things that are challenging for the right reasons.

I've heard this described as inherent complexity versus accidental complexity. Inherent complexity (due to difficult real-world constraints) is fine. Accidental complexity, like that caused by overcomplicated tools or architectural decisions, just feels bad.

And then you have weaponized accidental complexity, aiding cv-driven development and vendor lock-in (which are really the same sort of thing).

Re: Hardest problem in computer science: centering things

#139
post #106

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…

When people say not to use tables they mean for layout of the entire page

> they mean

They shouldn't had mean, they should had said that.

Because 99% of time we have a bunch of

in assortments of representing a tabular data. Dozens of "web" "front-end" "frameworks" doesn't help it in any way, too.

Re: Hardest problem in computer science: centering things

#140
It don't even talk about CJK though. CJK texts mixed with latin characters is also a giant source of headaches.

For example, the following characters: "jh中"

Depend on the use case, you may want the "中" to align with "j" (for a tight layout like terminal) or "h" (normal articles). But there is never a way to specify it. You just pray that it is correct or your text gets clip out in tight layouts.

Post reply on HN