Let's say "→" misrepresents the meaning of "->" even as much as 0.1% of the time. Would you rather your risk of error be 99.9%, or 0.1%?
I'm sick of anti-ligature people telling everyone else not to enjoy their fonts, on every single post about a font. Ligatures have caught on for a reason.
Who is doing that? Certainly not the author. It sounds to me like you're taking the author's opinions as a personal affront, which seems... weird.
It's certainly not the most neutral phrasing.
The point is that programming isn't just an exercise in semantics. But it is deterministic symbolically.
Most other ways of code sharing you just copy and paste into a non-ligature font if you need to.
Aside: "ASCII" symbols are neither universally shaped or styled either. The easiest and obvious example to mind is the plain 0, dotted 0, slashed 0 choice and confusion with nearby symbols such as O and o and θ (Theta, not far away in "Extended ASCII"). Similarly all the variations of lower-case L (versus 1 and i). Those choices vary considerably between fonts and are another huge reason some people prefer certain monospace fonts over others and the debate over "best" will likely be an ever ongoing one. You may not think these issues compare to ligature use, but it's exactly the same sort of style debates.
I'm sure it's a highly personal thing, but Matthew Butterick proclaims it's more universally bad than it actually is.
That is why there's a checkbox for enabling ligatures.
Like why is this a thing? It's like proclaiming certain font sizes aren't worth it. My dev machine is my interface. I should be able to do what I like with it.
Edit: I guess he addresses this in a footnote, but hardly:
> “What do you mean, it’s not a matter of taste? I like using ligatures when I code.” Great! In so many ways, I don’t care what you do in private. Although I predict you will eventually burn yourself on this hot mess, my main concern is typography that faces other human beings.
A) I've never burned myself b) other than screen shares (again, nary a complaint, but several "cool! How do I get that?") I'm never rendering code for others to consume. I agree that a ligatured font would be bad e.g. for publishing code in a whitepaper.
The worst offenders tend to be anything involving '!' and '=' and the many varying stylistic interpretations of it. It appears that font designers are in a race to outdo each other, or introduce it for the 'coolness' factor and eschewing the practicalities involved.
But I don't want to be a grump and I do keep trying out ligature fonts every now and again, always with negative results.
Perhaps if some radical homoglyph defenses get established they could also take this sting out of ligatures? (how about highlighting everything that cannot be typed with your current keyboard layout, or with the layouts in whatever quick access scheme you might have?)
Yeah, no thank you.
Also, I notice that Jetbrains Mono doesn't ligature ~= as !=, but that is what it means in Matlab. So it really seems like assumptions about language semantics is baked in to the font.
Jetbrains Mono does offer the no-ligature version.
I've used ligatures now for several years (with JetBrains Mono in particular for some time). I've done lots of pair programming and a common immediate reaction is "How can I get those too?! It makes it so nice to read and understand".
Instead of throwing them out because of some edge cases, why not improve the software for the edge cases?
- Me
I honestly really didn't like them at first, but I came to love Fira Code after a couple false starts.
My IDE catches the errors this guy mentions.
> I don’t care what you do in private. Although I predict you will eventually burn yourself on this hot mess, my main concern is typography that faces other human beings. So if you’re preparing your code for others to read—whether on screen or on paper—skip the ligatures.
I also hate dark mode and small fonts, and I let my code run way past 120 chars per line when it's right to do so.
I couldn't possibly care how other developers read code. I want them to be able to read my code and so I try to code for clarity, but I can't imagine a font choice or many other IDE preferences affecting their ability to read the code I write.
[0]: https://github.com/madmalik/mononoki/issues/29#issuecomment-...
So languages that want to express more with different symbols find it difficult to do so with our limited set. You end up with combinations of symbols that look familiar to existing combination of symbols, and for those who find this problematic to read we have ligatures.
Also, if something doesn't turn red when you swap an = for a == then it's time to re-evaluate code coverage.
Edit: I should note that I mainly write C and C++. Other languages may make ligatures less pleasant
That leads into my personal issue with ligatures: they change what should be a binary operation into a more complex one. Instead of "I see equals signs, one space or two?" it becomes "I need to stop, change to a vertical reading direction, and see if that's 2 or 3 lines" or "I need to estimate if that is 2 or 3 characters worth of width, or get off track comparing it to characters on the line above." Comparison operators should simply be "greater space equals" but become "wait, was there a second line there? I have to go back and double check that."
I'm sure someone will come along and say "how is reading the number of spaces different than reading the number of lines?" It might be that the spacing is normalized without ligatures, it might just be the vertical spacing in ligatures is too small, I don't really know. It's incredibly difficult to convey this to someone who doesn't experience it, all I can say is it is a night and day difference to me.
I've given Fira Code a shot 2 or 3 times but have found the ligatures to hinder my productivity every time. I also tried them just in the "reader mode" with Jetbrains Mono when that feature was first released, but had to turn it off after a few days.
That all being said, I won't fault anyone for using them if it helps them in the same way that not using them helps me. I'm just glad they can be disabled in Jetbrains Mono as it is otherwise an incredible font.
While this is true, it doesn't seem to come up that often in practice. I'd say this appears when I'm viewing log files or something that isn't a programming language.
Bottom line is it's just there, enable or disable depending on your preference.
Surely the readers are reading the code in the font of their choosing. If they get miscued by ligatures, that's squarely on them, because they're the ones that chose to read it in a ligature font. That's the beauty of fonts - they can be very personal.
I also think it would be interesting if a programming language used the Unicode characters that ligatures simulate rather than combinations of general purpose characters, but that seems unlikely given that it’d require a new programmer-oriented keyboard layout.
Dyalog still has special APL keyboards.
Hilarious enough, many of the people who claim ligatures are objectively harmful are also those using archaic tools like vim/emacs. The number of errors that could've been prevented by highly sophisticated IDEs instead of toy text editors from the 80s is surely orders of magnitude higher than the purely theoretical ligature confusion.
Having a ligature for != but not for the others betrays its language-independent semantics.
!= in Matlab is not legal logic operator.
Also, != might be part of regular expression.
Using Haskell is one such situation. Haskell's inequality operator is /= which someone could expect when they see ≠. Some people redefine != as a custom operator (see link), which can bring even more confusion with this ligatures.
I was using this font in Rider when JetBrains made it the default, but gave up after several months. The ligatures were giving me a pause still. The effect was opposite to ease of reading the code.
But I still use them ;).
So I can imagine when there are tools to prettify code for blogs this can become an issue for some languages.
While not entirely related to ligatures, my own biggest offender has been strange whitespace being treated as an identifier in LuaJIT. Mostly caused by my Norwegian keyboard layout producing strange whitespace when you want to write the not operator "~=" if you're not careful enough.
You can blame many parts here, LuaJIT for allowing this in the first place, editors lacking tools to deal with it or normalize pasted code, me for not using a us layout, me copy pasting code, or me not being careful enough.
Thankfully vscode will now highlight non standard whitespace with a yellow box. And best of all I've learned to be aware of these things when copy pasting code from the browser.
> 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.
- Matthew Butterick, Ligatures in Programming Fonts: Hell No, https://practicaltypography.com/ligatures-in-programming-fon...