Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

361–370 of 473 posts

Re: Hardest problem in computer science: centering things

#362
post #98

Don't read this article, if you are not in web dev. Once you start seeing it, you can't stop seeing it, and it will drive you crazy forever. It is the same for noticing misalignment, recognizing color oversaturation, high quality speakers/headphones, etc. (It is a good article!)

The same happens when you: - Install flooring - Install trim in your own home - Build / install cabinets You will now see: - Odd flooring patterns and uneven floors - Know what it looks like when trim isn't coped - Uneven gaps between doors

If you can't cut it right, caulk it white.

Re: Hardest problem in computer science: centering things

#363

Earlier quoted context omitted.

> 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.

Hey now!! I represent this remark!

Re: Hardest problem in computer science: centering things

#364
One important thing is to avoid adjusting alignments between two things by offseting against a third one. Typically, offsetting both the icon and text relative to container. And less infernal approach is the align the icon relative to text (eg: use percent (or em!!) vertical align for icon to offset relative to text), and _then_ adjusting centering in container.

Ho, and take car of sub pixel when adjusting, they cumulate, and rounding will bite you !

Re: Hardest problem in computer science: centering things

#365

Don't read this article, if you are not in web dev. Once you start seeing it, you can't stop seeing it, and it will drive you crazy forever. It is the same for noticing misalignment, recognizing color oversaturation, high quality speakers/headphones, etc. (It is a good article!)

Hi I heard you might like to learn about keming.

[deleted]

Re: Hardest problem in computer science: centering things

#366

In case the author reads this: Please respect prefers-reduced-motion for your cute mouse cursors that wander over the screen in a very distracting fashion. In the meantime, as a fix for others, in uBo add tonsky.me##.pointers

Even better, add this to block the websocket connection for the pointers:

  ! Annoying pointers on blog
  wss://tonsky.me/ptrs?*

Re: Hardest problem in computer science: centering things

#367
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…

The gap also helps with expansion, otherwise the hardwood panels will form ridges in the middle of the floor.

Re: Hardest problem in computer science: centering things

#368
post #350

Earlier quoted context omitted.

It’s ‘skirting’ here in NZ.

Probably throughout the Commonwealth, skirting or skirting board (it is here in the UK too), and a confused Canada as for most of these words!

This time the coin-flip of Canadian nomenclature landed on "American"; we call them baseboards.

Re: Hardest problem in computer science: centering things

#369
post #267

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.

That’s not true though. You don’t need different styles for text on different platfroms. They all work the same

I'm not sure about your experience, so I don't want to diminish it, but I have patently not found this to be true at all.

Re: Hardest problem in computer science: centering things

#370
post #342

Just a few weeks ago we released a feature where one of the most prominent buttons had a misaligned icon. The feature was reviewed by the QA engineers, the product owner reviewed it etc. I was the first person to notice it. After I pointed it out, everyone started seeing it, too. However, I had to specifically mention that there is a misaligned icon on a certain button. People couldn't see what's wrong even when care…

> "the icon is not centered correctly".

Would "the icon is not centered" have sufficed? :)

Post reply on HN