Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

271–280 of 473 posts

Re: Hardest problem in computer science: centering things

#271
post #266
post #98

Earlier quoted context omitted.

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

This is what causes me absolute task initiation paralysis - the fear of not being perfect - even with my new attempt at adherence to "don't let perfection be the enemy of good enough" Does anyone else who comes into the house notice anything? Very unlikely unless they are craftspeople.

Here's how you do it, make everything so poorly in terms of fit and finish that it becomes hard to find things that are perfect (or even good). Embrace the aesthetic.

Re: Hardest problem in computer science: centering things

#272
post #261

Why do you need to remember four words instead of just `horizontal`/`vertical`? Why did `justify-content` became `justify-items`?

Because `flex-direction` exists, which means that horizontal and vertical are contextually meaningless. https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direct... I don't agree with the inconsistent naming across the axes, however horizontal/vertical isn't the answer to it.

Or you can just ditch flex-direction... It’s not like it serves any great purpose

Re: Hardest problem in computer science: centering things

#273
post #193

Earlier quoted context omitted.

I have this with grammar. When I read modern websites, articles, papers, emails from HR, etc. with their sloppy English and comma-splices everywhere, it annoys me way too much and it's a real challenge to push on through and keep reading. It feels like walking through a maze, with an uneven floor and bad lighting, full of dead-ends, compared to walking down a pleasant, well-lit corridor.

For me, it's the all-lowercase style of some of the current in-vogue AI leaders like Sam Altman that drives me crazy. Is your shift key... broken? No? Use it please.

97% of people don't use a shift key for capitals now it seems

Re: Hardest problem in computer science: centering things

#274

> Should you use icon fonts for icons in 2024? > Are you limited by 1970-s tech e.g. terminal? This accidentally highlights yet another problem with icon fonts. Terminal-based browsers with image capabilities, e.g. w3m, can display image-based icons. Fonts on the other hand are (usually) unchangeable on terminal emulators. So if you use icon fonts, it will look like garbage on terminal browsers, but with images there…

> Sure, who cares, nobody targets w3m in 2024.

I care. There's still w3m users out there - and I am one of them.

I don't care if the website looks like shit, but at least keep it usable for us.

Re: Hardest problem in computer science: centering things

#275

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!)

Obligatory xkcd reference: https://xkcd.com/1015/

Re: Hardest problem in computer science: centering things

#276

I mostly agree, but not entirely. The problem is that things that are lined up look nice from far away, and very close up, but not always when reading text. The Apple "Manage" button is the simplest to illustrate. You might think that just having equal vertical space above the M and below the g is the best, but when you read text you're also used to seeing letters stick out of the bottom of the line. So having the g…

You align by the space between cap-height and baseline. Always. It always looks good. Even for lowercase. You don’t need to think further. That’s it. That’s the solution

Re: Hardest problem in computer science: centering things

#277
post #98

Earlier quoted context omitted.

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

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’ve noticed these things all my life.

I was about to write: As someone late-diagnosed[1] with ADHD[2] and discovering they're autistic, ... -

>Once I was diagnosed with autism, this tendency of mine made a lot more sense.

...yup. This is what I was a about to write.

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

The answers to that are no and yes, that's the blessing and the curse of autism.

Seeking and recognizing patterns is one of the defining traits.

_____

[1] https://romankogan.net/adhd#Diagnosis

[2] https://romankogan.net/adhd/#Awfully%20Described%20Human%20D...

Re: Hardest problem in computer science: centering things

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

They did center everything correctly for decades, do you think it was a mistake? https://grumpy.website/938

Re: Hardest problem in computer science: centering things

#279

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. Not a myth in any way shape or form. Tables for layout (not tables in general) were discouraged with various arguments in favor of "float/clear", even decades before a sane substitute (grid/flex) was available. > Other positioning systems…

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" (not sure what you're referring to here, the standards bodies?). Endless articles from the mid 2000s kept saying tables bad, here's how you layout without tables. All of them used floats for layout, not display:table. Partly I suppose this was because IE didn't support it until 2009, I think.

Nearly all layouts people actually want are table-like, and I think CSS really was misguided in its text-flow as layout approach.

Re: Hardest problem in computer science: centering things

#280
post #106

Earlier quoted context omitted.

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

They should not have advised against that either. It was a much saner, simpler, and more efficient mechanism that the clear/float monstrocities imposed upon people in the period before grid, which reinvented the same thing (table layout) just without the actual tags.

You could use ‘display:table’ in CSS if you wanted a tabular layout without using the table-tags. This has been part of CSS for 25 years.

Grid is newer and more powerful.

Post reply on HN