Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

301–310 of 473 posts

Re: Hardest problem in computer science: centering things

#301
Yes CSS is hard, yes declaratively anticipating all the various types of media you may display on and their relative interaction is a nightmare of variables. BUT, that is enough to justify the inversion from using declarative markup to actually writing some procedural code. Write a function to measure the screen, measure the elements on it, and adjust them dynamically at runtime.

Re: Hardest problem in computer science: centering things

#302
post #119

Earlier quoted context omitted.

Jup. Somw people like to think centering things is taking the bounding box of the visible pixel and centering the center of the bounding box. But some letters have more pixels in one half or the other, so that would leave you with more whitespace one one or the other side. That means despite being metrically centered it still doesn't look optically centered. I guess one could devise algorithms for that, but I haven't…

> Somw people like to think centering things is taking the bounding box of the visible pixel and centering the center of the bounding box. That was my naive understanding for probably my first year at the uni. It got cleared up fairly quickly. I imagine there can be typesetting/layout styles where this holds, but I would classify them as niche (maybe brutalism or something like that). Funnily enough, in the very firs…

You can actually still do it. Just don't measure until after the fonts and elements are in place. dynamically adjust the position afterward. There is no rule that says you must use only CSS

Re: Hardest problem in computer science: centering things

#303

Earlier quoted context omitted.

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"

If you want to make your existence slightly more irritating: Learn German and move to Germany. There the possessive s ending is written without an apostrophe - but there is an equivalent which then falsely writes the possessive with an apostrophe - the so-called Deppenapostroph (idiot's apostrophe).

What annoys me most about German vs English is that German has lots of English loanwords ending in "y" (e.g. "Party"), but it's officially not allowed to use the plural form that would be correct in English, e.g. "Parties" - you have to write "Partys". As a bonus, you could try using "Party's", but that would be incorrect again...

Re: Hardest problem in computer science: centering things

#305

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

#306

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.

Thank you, my day is ruined.

Re: Hardest problem in computer science: centering things

#307

Earlier quoted context omitted.

They weren't really idiots, though, that's quite harsh. People wanted to be able to share software but there were so many barriers to entry at the distribution/installation/update phases that they used the solution that didn't require any of that. It was a hack but it worked better to serve the needs of the users.

Come on, there are so many native cross-platform solutions which are easy to go and much less bloated than web engine, e.g. Qt/GTK+/wxWidgets/Xamarin/etc.

Now take that beautiful application you have made and your customers want, and beg the trolls who sit between you and them for permission to distribute it.

Assuming you get said permission some weeks later, now hand over double-digit percentages of your top-line revenue to these despicable rent-seekers, do the same with your tax payments and notice how you're left with less than 30% of the value you have created.

Re: Hardest problem in computer science: centering things

#308

Earlier quoted context omitted.

They weren't really idiots, though, that's quite harsh. People wanted to be able to share software but there were so many barriers to entry at the distribution/installation/update phases that they used the solution that didn't require any of that. It was a hack but it worked better to serve the needs of the users.

Come on, there are so many native cross-platform solutions which are easy to go and much less bloated than web engine, e.g. Qt/GTK+/wxWidgets/Xamarin/etc.

All of those would require an user to download and install something, no? How do you push updates?

Re: Hardest problem in computer science: centering things

#309

Earlier quoted context omitted.

Is that autism thing? My therapist suspect I'm autistic, and I have always noticed things like this - or trying to align everything in my mind when I look at things, or trying to split the into two halves of equal volume.

>Is that autism thing? My therapist suspect I'm autistic, and I have always noticed things like this - or trying to align everything in my mind when I look at things, or trying to split the into two halves of equal volume. Very much in line with being neurodivergent. Sounds more like autism than ADHD, but it's hard for me to tell, 'cause I'm both[1]. [1] https://romankogan.net/adhd

... I guess another thing to bring up during session. Thanks. (and to the other person thanks too, but I don't want to make another post)

Re: Hardest problem in computer science: centering things

#310
post #281

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’m curious if other people detect interrupted or irregular patterns so readily All the time, and I learned to not care a lot, even like some; for instance there's a lot of (mostly abstract, surrealism) art which does all the things wrong on that front but which is extremely enjoyable to me. Same weird way with music: exact 4/4 stuff is mostly boring, often even annoying, but give me funky off-beat stuff, chaos and n…

But then there is the intentional curvature in ancient stone columns, where ther the pillar is neither a perfect cylinder nor even a perfect cone, and it's on purpose because actual perfect forms don't look right to humans.

Like one part of the article shows the Apple logo in a circle, and the correct centering is not to have all points on the logo equidistant from the circle, but to allow the leaf to go a lot closer than the rest.

Post reply on HN