logoalt Hacker News

jve • yesterday at 10:47 AM • 20 replies • view on HN

Is it only me but I really dislike "Code Ligations"? I have to mark some chars to count how many consecutive "=" simbols there are... or \/ looking like V without having other chars near it to distinguish. Having to copy paste diamond shape to find out it is <>. arrows with squiggly tails, /> being ugly, <. having dot in the middle...

That could be the maximum I'd like out of font to have "proper" greater/less-equal sign.


Replies

slazaro • yesterday at 10:53 AM

They always seemed to me like solutions to a nonexistent problem. They make the code less readable, but ligatures exist and they seemed like a cool tech thing to implement, and they might look cool in screenshots. But in practice, in my opinion, they're worse than just having the normal characters. But I guess it's a matter of opinion, no harm in other people using them.

➕ show 4 replies
Semaphor • yesterday at 11:19 AM

Common complaint.

Personally, I like them. They look pleasing and I never had issues distinguishing between the ligatures for ==, ===, and = itself.

ragnese • yesterday at 12:22 PM

I thought I was the only one! I figured I was either crazy or getting old and stuck in my ways. The first I'm I saw a font with them, I thought it was cool and tried it out. I almost immediately hated it. I've tried a few more times for varying lengths of time, and I've decided that I really do hate them.

strenholme • yesterday at 1:51 PM

I have used Fontforge to remove all ligatures from a programming font; e.g. my monospace font of choice is a aggressively subsetted variant of Fira Code with no ligatures whatsoever.

https://github.com/samboy/CaulixtlaFonts/tree/main/MiscFonts...

➕ show 1 reply
bita_nidir • yesterday at 12:33 PM

I logged into HN to upvote your comment. Code Ligations are an absolute abomination.

apetrovic • yesterday at 10:59 AM

I like them and use them. But every editor I worked with has an option to disable ligatures.

➕ show 1 reply
sicktriple • yesterday at 1:49 PM

Ligatures suck. That's what Iosevka Fixed is for.

semiquaver • yesterday at 10:51 AM

ligatures, not ligations

➕ show 2 replies
graypegg • yesterday at 3:32 PM

I personally like them because (to me) it makes a few symbols less ambiguous. (I use Victor Mono [0], so in my mind things like == and === in that font makes mistakes more obvious to me at least.)

But also... I know I have the minority opinion on this. It absolutely should be opt-in, not opt-out. I think the past decade, I've been told the font tweaks I enable are incomprehensable to everyone I work with. The way I like my IDE fonts is far outside the bell curve (ligatures, cursive variants for some syntax, proportional variants for prose) so the fact that most new monospace code-focused fonts seem to align with my opinions should be concerning to font makers! I like that I don't have to patch a different font's italics into my code font anymore, but common sense says I SHOULD still have to do that!

[0] https://rubjo.github.io/victor-mono#ligatures

rbanffy • yesterday at 4:51 PM

The VT-340 didn't support ligatures, therefore, we shouldn't use them ;-)

Now, seriously, a programming font has no (and should never have) awareness of the computer language it's representing. Ligatures make sense if they present meaning in a way easier to read than the non-combined characters. I can't type := in APL and expect the REPL to think it's an attribution arrow (←).

I get APL is a rather extreme language to talk about, but this is one example where ligatures would harm the programmer (unless your editor replaces a ":=" with a "←"). Source code is a very precise language and the choice of characters you use matters a lot. A "<-" doesn't mean "←" unless the language declares so.

kps • yesterday at 1:27 PM

Yeah, Unicode shipped 35 years ago. If you want a ≠ then use a ≠.

➕ show 4 replies
nsvd2 • yesterday at 7:30 PM

I love them. I suppose it's personal preference

spiderice • yesterday at 5:48 PM

This is brought up in every single thread about fonts that have code ligatures. So no, of course it isn't just you.

mkesper • yesterday at 11:01 AM

The 'fixed' variant disables them.

boltzmann64 • yesterday at 1:03 PM

I used to hate font ligatures until I discovered Commit Mono (my all time favorite monospace font). They use the ligatures only to adjust spacing and make it look better on a monospace grid. No stupid <=, -> ligatures or anything else.

doodpants • yesterday at 3:39 PM

You and me both. Ligatures are a solution to a problem that monospaced fonts don't have. I don't mind if a mono font uses ligatures to harmonize character spacing/alignment a little bit. But I don't want things like a "proper" greater/less-equal sign; if a font goes so far as to replace >= with ≥, then it's lying to me about what characters are actually present in the file.

➕ show 1 reply
cloverich • yesterday at 4:57 PM

They are in the tabs vs spaces camp. Choose your preference and walk away, silently. Unless you consider yourself a Real Programmer, in that case, fight to the death about the matter.

(...I also find them annoying to look at, idk why)

pmontra • yesterday at 1:02 PM

It's not only you.

wildrhythms • yesterday at 10:57 AM

I hate them. I disable them in every code editor. I don't need to have to guess if it's a double equals or a triple equals

➕ show 2 replies
WesolyKubeczek • yesterday at 12:16 PM

Code ligatures look like the final desperate attempt of an aging hipster, a Ruby on Rails and Web2.0 early adoptr (sic), the type to wear thick-rimmed fake glasses and a scarf in the middle of summer, to be cool, as he is riding his old Segway, with a glass of soy latte in one hand and an avocado toast in the other, into the void of oblivion.

I don't like them because I never know what they actually stand for in ASCII.