this post was submitted on 09 May 2024
445 points (92.2% liked)

Programmer Humor

32558 readers
405 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] aport@programming.dev -5 points 6 months ago (5 children)

Ligatures 🤢🤮🤮

[–] DmMacniel@feddit.de 11 points 6 months ago (1 children)

What's wrong with Ligatures? It makes reading code a bit more tolerable.

[–] Ephera@lemmy.ml 11 points 6 months ago (2 children)

I mean, I certainly wouldn't give someone else shit for using ligatures, but personally, I don't like them, because:

  • they break with monospacedness. Everything is in a nice grid and you've randomly got these character combinations that needlessly stick out.
  • they sometimes happen in places where they really shouldn't.
  • they hide what the actual characters are. Especially, if go to edit that code, my brain will really struggle for a split-second when there's a '≠', then I delete one character and rather than the whole thing disappearing, I'm left with a '!'.
[–] Faresh@lemmy.ml 2 points 6 months ago (1 children)

they break with monospacedness

The IDEs I've used had the ligatures be of the same character width as the original operator.

[–] Ephera@lemmy.ml 1 points 6 months ago

Oh, yeah, I meant that it makes two characters into one big one, visually reaching across two or three widths, or just having one of the characters larger than the usual grid, e.g. in := the equals sign reaches into the width of the colon.

This reminds me of a recent Microsoft font¹, so naturally here's a rant about that: They developed a feature, called "texture-healing", which basically allows characters that normally need to cramp into one monospace width, like m or w, to reach into the space of neighboring characters, if those neighboring characters are narrow, like an i.

In theory, not a terrible idea, but then you get this kind of hate crime:

Obviously, might just be me again, but not having these letters align, just looks so much worse to me.

¹: It's this font: https://monaspace.githubnext.com/

[–] red@sopuli.xyz 1 points 6 months ago (1 children)

Do you also get surprised when you backspace a tab and suddenly it removes more whitespace than 1 characters worth?

Or did you learn it fast and really never think about it?

I think it's more a "getting used to" thing, that once learned, you don't think about, but it makes things more readable.

[–] Ephera@lemmy.ml 3 points 6 months ago (1 children)

Sure, I could get used to it. But it being more readable is not even true for me, because the thing I got used to instead, is that != is the unequals-operator. I see that much more often than ≠.

[–] red@sopuli.xyz 3 points 6 months ago (1 children)

Studies show that ligatures improve readability, but I acknowledge that it's likely untrue for outliers.

[–] Ephera@lemmy.ml 2 points 6 months ago

For monospace fonts? I've heard of such research for proportional fonts, where ligatures definitely make sense to me. But yeah, I wouldn't assume such research to automatically translate to monospace.

[–] red@sopuli.xyz 6 points 6 months ago

I mean, we read code more than we write it. You just vomitted over something that increases readability. Maybe a time for a rethink?

[–] nukul4r@feddit.de 5 points 6 months ago

You're brave (I don't agree)

[–] xmunk@sh.itjust.works 3 points 6 months ago

I fucking hate that If style.