I thought programming fonts are typically monospaced, which means collisions (which create the need for ligatures) aren't much of an issue. I agree that ligatures aren't good in programming, but it just seems the need wouldn't be that great. Or am I missing something?
Ligatures in Programming Fonts: Hell No
21–30 of 89 posts
Re: Ligatures in Programming Fonts: Hell No
#22Still, Perl 6 I think has the better solution: use Unicode well with ASCII fallbacks. Combine it with editor language modes that are aware of the equivalents and do Unicode substitution when the ASCII combo is used, and you get a situation all-around better than ligatures.
Re: Ligatures in Programming Fonts: Hell No
#23Used judiciously, ligatures can help make code more readable, not less. Consider JavaScript's == and ===, and their inverses != and !==. I personally find them difficult to visually distinguish on occasion (especially the negative forms). Fira Code [0] replaces them with two-bar and three-bar equals signs (something like =, ≠, ≡, and ≢, only wider; see the link for a screenshot). I personally find these easier to dis…
> Fira Code [0] replaces them with [...] And that's how it should be done. If you want something modified visually then you can modify it for yourself without pushing it on the rest of the world. Edit: Disregard that, I was being dumb.
Fonts with ligatures, such as Fira Code or Hasklig, work by replacing characters with a ligature. The actual source code is still "->" or "===" or "|>" or whatever it may be.
No one is "pushing it on the rest of the world"?
Re: Ligatures in Programming Fonts: Hell No
#24I thought programming fonts are typically monospaced, which means collisions (which create the need for ligatures) aren't much of an issue. I agree that ligatures aren't good in programming, but it just seems the need wouldn't be that great. Or am I missing something?
OTOH, perhaps because I use a proportional font, I would be curious to try one with operator ligatures. The interesting thing is that a ligature for !== wouldn't have to be three characters in width to preserve alignment, it could actually be the normal ≢ glyph.
This suggests an experiment: I'm already using a modified version of Trebuchet MS (my favorite coding font, but the tilde sucks so I swapped one in from a different font), so I could probably add some ligatures like the one above using existing glyphs instead of having to draw them by hand. I will have to try it sometime!
Re: Ligatures in Programming Fonts: Hell No
#25The article would have been a lot better if there was at least one example of where a coding ligature was a problem, rather than talking about feet and inches For instance it mentions the pairing => but provides no examples. After reading I’m far from convinced that carefully curated language specific ligatures are a bad idea.
Re: Ligatures in Programming Fonts: Hell No
#26I never want a programming font without ligatures ever again.
This article, to me, seems like a case where the authors' ire is proportional to a) their understanding of the subject b) how relevant the topic is.
Because really, a) ligatures won't cause catastrophic failures by rendering code illegible and b) it really, really doesn't matter all that much. Non-destructive personal preference.
Re: Ligatures in Programming Fonts: Hell No
#27If anybody wants an example of where ligatures will cause problems, try playing a roguelike in a console using the Fira Code font with ligatures turned on. It demonstrates that accidental collisions end up with completely different glyphs. My first experience with this was with Dwarf Fortress in text mode. But... I have to say that this is the only place I've actually come across it. I eventually decided that I don't…
But... why? It's obviously not intended for that purpose. You would get awkward results trying to program with a regular serif, too, but that's not a fault of the entire category of serifs.
Re: Ligatures in Programming Fonts: Hell No
#28I thought programming fonts are typically monospaced, which means collisions (which create the need for ligatures) aren't much of an issue. I agree that ligatures aren't good in programming, but it just seems the need wouldn't be that great. Or am I missing something?
Ligatures in programming fonts usually don't want to solve the problem of character collisions. Instead they transform rather weird symbol sequences used in programing to something closer to symbols used in maths or how you would write it by hand, e.g. != becomes ≠, = https://github.com/tonsky/FiraCode
Re: Ligatures in Programming Fonts: Hell No
#29Fira Code's main problem is that it tries to be a font for all programming languages which results in some weird behaviours here and there. Unfortunately, there's no good way to have a font have sets of ligatures per . That said, however, the article fails to provide a compelling argument against ligatures. 1. Fonts have nothing to do with Unicode. It's exactly the font's job to provide any glyphs or ligatures it wan…
Absolutely agree. Medium.com (as an example) has a bunch of flaws, but some of my favorite articles are their posts about bringing classical typography back to the modern web.
Re: Ligatures in Programming Fonts: Hell No
#30Used judiciously, ligatures can help make code more readable, not less. Consider JavaScript's == and ===, and their inverses != and !==. I personally find them difficult to visually distinguish on occasion (especially the negative forms). Fira Code [0] replaces them with two-bar and three-bar equals signs (something like =, ≠, ≡, and ≢, only wider; see the link for a screenshot). I personally find these easier to dis…