Hacker News new | ask | show | jobs
by LiamPowell 2 days ago
The state of ligatures is getting ridiculous. I had no idea what !=== was until I copy-pasted it, nothing in that ligature even resembled the underlying characters.
5 comments

I'm firmly anti-ligature (the "coding" ligatures; normal text ones are fine). I always pick the variant that doesn't have them, or a different font.

I actually do like Iosevka, which this is based on, but just use the "Fixed" version.

I think they could be good. I'd be fine with a == ligature that cuts of a bit from the left of the left glyph and a bit from the right of the right one (adding a bit more padding to better separate the operator from the surroundings). Or a -> that squishes the two glyphs a little rather than extending the dash to merge them entirely.

What most of these fonts do is pretty crazy though, especially with = and ==.

Yes they better only adjust the spacing or character shape so that they are still distinct symbols and not become a new symbol. For example, replacing --> with an arrow changes the meaning especially given that there exists actual arrow symbol. And the ligature for </ is just ugly. In code you need to see what every character exactly is (and be able to see special characters like tabs or non-breaking spaces).
Ligatures don't belong to code. Code is meant to be "parsed", you cannot spend any additional brain cycles on "beauty" that itself needs parsing.

Like a lot of design trends, it's design for design's sake and it's at odds with its actual intent.

You have it the wrong way around, I'm afraid. Traditional ligatures (fi, etc.) are absolutely about readability, i.e. they make it easier to visually parse the text correctly.

For code font ligatures, there is such a thing as going too far, but done tastefully, they can be a help.

Ligatures were introduced for readability because in non-monospaced fonts characters could collide. Given that virtually every person reads code in monospace there's no function to ligatures.

And as for readability, there's an even bigger problem in that semantics matter immensely in programming. != should be replaced by its mathematical operator if you're writing a comparison, but potentially not in a string, comment or regex. Because fonts do character replacement, they're entirely unaware of programming semantics. You essentially add a context unaware level of interpretation on top of what used to be unambigious text.

Trad ligatures where not in monospace fonts, right? Cannot imagine what `fi` looks like ligatureized, and even less how it would benefit readability.
I originally didn't like ligatures for this reason.

But I decided to give it a shot later and my brain adapted to it just fine. Now when I use fonts without ligatures it just feels like something is missing. It just reads more comfortably with ligatures.

I think the same will happen with the texture healing thing people are discussing elsewhere. I have the impression they will distract me more than help me reading comfortably. I am willing to try it just to see if my brain will adapt to it as well.

I don't even understand why people bother to make this argument. It's someone else's business and has nothing to do with you. Maybe it turns out your colleagues don't even see ligatures because they code orally with Claude. Who cares?

Maybe you look at your colleague's screen and it's all dark yellow and hardly visible to you. Who cares?

Yeah the ==, === based ligatures actively hurt readability because they turn a simple delineated count into an eyeballed measurement.
whats so hard to understand ? its just a not-equals symbol with 3 lines instead of 2. If i saw that in a Js file. I'd know instantly what that meant
See the sibling comment. On top of that, how am I meant to tell the different between /= and !=? How about =/= and !==? All of those are widely used across different languages and you might even see both at the same time, say a JS snippet being delivered by a web server written in Ada.

Plus why is it a triple bar when ≡ already exists and is widely used? It's just inviting confusion.

There are two ligatures with three lines instead of two. The shorter one is !== and the longer one is !===

Besides the length, there's no difference between these.