Matthew Butterick on Ligatures in Programming Fonts

Matthew Butterick:

Ligatures in programming fonts are a terrible idea.

And not because I’m a purist or a grump. (Some days, but not today.) Programming code has special semantic considerations. Ligatures in programming fonts are likely to either misrepresent the meaning of the code, or cause miscues among readers. So in the end, even if they’re cute, the risk of error isn’t worth it.

After kicking the tires with JetBrains Mono a few days ago (and taking a peek at Fira Code, another coding font with ligatures), I quickly came to the same conclusion as Butterick. It’s a bad idea that works contrary to the idea of how ligatures are supposed to work in typography.

If you’d rather see than != in your source code, your programming language should support the actual UTF-8 [NOT EQUAL TO] glyph in its grammar. As Butterick writes:

So in a source file that uses Unicode characters, how would you know if you’re looking at a => ligature that’s shaped like vs. Unicode character [0x21D2], which also looks like ? The ligature introduces an ambiguity that wasn’t there before.

Thursday, 30 January 2020