Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

31–40 of 473 posts

Re: Hardest problem in computer science: centering things

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

I am not even sure whether the sentence you quoted is genuine or sarcastic.

Re: Hardest problem in computer science: centering things

#36
post #34

The Apple one doesn’t seem fair. You can do the math to center the box but typography with descenders throws everything off. I think if they had centered it “correctly” it would feel off.

Which Apple one? Apple features a bunch in here. The Quicktime record button can't be explained by descenders.

Re: Hardest problem in computer science: centering things

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

Whats so terrible about the modern frameworks?

I used to have that attitude, but after trying the latest version of ReactJS I think its pretty nifty for what its intention is.

Re: Hardest problem in computer science: centering things

#38
post #14

> don’t ask why you need to remember four words instead of just horizontal/vertical, it’s still better than before The reason is "display: flex" can be a column or row. The "align-items" property describes alignment along the axis, so vertical for column and horizontal for row. The "justify-content" property is the other direction.

The other CSS terms for this are block and inline, as in padding-inline-start and padding-block-end. Whether it’s the top/bottom/left/right edge is determined by flow direction. iOS/SwiftUI calls the inline directions leading and trailing, but I’m not sure how it works with vertical type

Re: Hardest problem in computer science: centering things

#40

Text-Box-Trim I’m surprised ‘text-box-trim’ wasn’t mentioned. It’s a CSS attribute that solves this on the web. https://caniuse.com/css-text-box-trim If only browsers would support it. Until then, here’s a JS alternative. https://seek-oss.github.io/capsize/

Hardly worth mentioning a feature supported by...nothing

That's not true, it's obviously relevant to the article, plus, if it gets mentioned enough it's more likely to get support.
Post reply on HN