Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

391–400 of 473 posts

Re: Hardest problem in computer science: centering things

#391
post #15
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 :)

That’s actually arguably the source of the problem in a lot of these examples. In some of them, the bad alignment would look good if the text next to it contained more descenders. This could be compensated for, of course. For e.g. a single checkbox and text, move the text a bit lower if there are no descenders in it. But that doesn’t work if the text is user input, or if there are multiple text boxes in a list: it’s…

Agreed about Vietnamese, which brings up another issue: diacritics. A word or phrase that is heavy on uppercase with diacritics ("BÁNH CUỐN") will look quite different in the vertical plane from one with a lot of descenders ("eggnog"). Even for developers who don't worry about Vietnamese, it is quite common in North America to require support for Spanish and/or French, which can also feature a lot of words with diacritics: "¿Ándale, vamos?"

Re: Hardest problem in computer science: centering things

#392
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

Truth, I spend every free second in an Airbnb analyzing their trim, electrical, flooring, et c work. Spotting where additions were made. Can’t turn it off.

Re: Hardest problem in computer science: centering things

#393

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.

Fallback fonts are a legacy of the past though, in an era where everybody ships at least hundred of kilobytes of JS and images (when it's not tens of megabytes, but this is another topic…) there's no good reason to specify a font and hope it will be found on the customer's OS: ship the font you're using.

I'm probably in a tiny minority, but I just flat out disable third party fonts. Everything looks equally good to me and I save bandwidth. The only expression are image fonts, which render as squares - I share the author's frustration.

Re: Hardest problem in computer science: centering things

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

This is spot-on. HR is bad, but at least writing is not their main job, so I'm willing to cut them some slack. My main concern is the writing I see coming out of the Public Relations and Communications departments. Writing is not exactly tangential to those fields. It wasn't always this way. What has happened?

Maybe it’s related to how we (government, industry) used to routinely make great instructional videos and other learning materials, but are now largely terrible at it.

I suspect it’s all connected to the rise of a professional management class, rather than promotion through the ranks, and management by people who’ve done the work. Nobody who’s in a position to demand better or to make sure the right people are in the right roles, actually knows WTF they’re doing outside of a spreadsheet and PowerPoint.

Re: Hardest problem in computer science: centering things

#395
post #348

Earlier quoted context omitted.

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.

display:table was never really evangelized for tabular layout. They were pretty much ignored and the literature and documentation missed the point. Tabular layout is really just another word for grid layouts. Grid layouts took forever to arrive. Tables were the only reliable way lay things out in a grid for a very long time and yet were discouraged regardless. There were people who knew about display:table and used i…

Sorry are you saying ‘display:table’ was not viable for grid-like layouts because someone might confuse it with the html tag?

That is like saying Go is not a viable programming language because someone might confuse it with GOTO and consider it harmful.

Re: Hardest problem in computer science: centering things

#396
post #208
post #155

Earlier quoted context omitted.

The issue with CSS is not too much freedom. It is that as an API, it is frankly, retarded, horrible and ridiculous.

Long ago I made interfaces with image maps. Just one giant jpg with all links boxes and text on it. https://www.w3schools.com/htmL/html_images_imagemap.asp https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ma... I've seriously considered doing websites in pdf too but still have to run into a situation dramatic enough for it to be worth it. Now that I think about it again "installing" a pdf on a pc could cover…

active (PDF) documents seem to have become a thing on eReaders, especially pen-based ones; mostly they leverage clever linking and bookmarking, and not much more, though.

Re: Hardest problem in computer science: centering things

#397

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

Once you discover a mastering error in a song (or get told about it) it might ruin the song.

Re: Hardest problem in computer science: centering things

#398

> (also don’t ask why justify-content became justify-items) It didn't. `justify-content` works with grid too, and will bunch all the grid cells into the center. `justify-items` is if you want the contents of each grid cell to be centered. Also, `place-content` or `place-items` for grid does both the horizontal & vertical at the same time. I admit that CSS isn't always obvious how it works, but it seems like the autho…

also it's not named horizontal and vertical because it depends on the direction of the text - some text reads vertically

Re: Hardest problem in computer science: centering things

#399
post #273

Earlier quoted context omitted.

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

98% don’t use periods. ;)

This one is a bit more reasonable (to me at least). It seems to be an internet/texting convention that messages ending with a period are more formal/serious or potentially angry/irritated, whereas messages without a period are lighter/more fun. As an example:

“Have you taken the dog out?”

“Yes”

Vs

“Have you taken the dog out?”

“Yes.”

The second comes across as the responder being potentially irritated at the asker. I believe that this comes down to the amount of effort required to type the reply; adding a period is making the explicit choice to do so, whereas not doing so is the default. This isn’t the case for sentences in the middle of a multi-sentence answer, since a separator is needed anyways. But I find myself not adding a period even at the end of multi-sentence messages, and I automatically read any message ending with a period with a different tone than one which does not.

Maybe I’m just nuts though, that’s always an option. But with text being such a relatively limited medium for conveying emotion in short messages, I think this is a reasonable solution.

Re: Hardest problem in computer science: centering things

#400
post #297
post #108

Earlier quoted context omitted.

Before CSS people used to use tables, often nested, for all kinds of layout. Eg if your page had a header, a sidebar and a main text area, you would create a table with cells of the right relative widths, with invisible borders, and put each layout element in one possibly merged cell. This was essentially standard practice for a while. CSS allowed layouts like this to be done without tables. It still supported tables…

Funny thing is that it still easier, even today, to use a frameset rather for header, sidebar and main area rather than fiddle with the new grid system.

Are framesets even supported in modern browsers? They have been removed from the html standard.
Post reply on HN