The ligatures are really interesting, but at a glance I process them so much slower than the raw characters, especially the ones that change the graphical semantics such as <= vs ≤. Does anyone have experience getting used to these and 1) does it end up faster? 2) once you are used to it is it harder than it was before to process the raw characters when reading code in fonts that don't have the same ligatures?
For me it's not a matter of speed, but distinctness and fitness to the meaning.
A ligature happening is kind of a "syntax affordance" saying that the code is correct, and it indeed says "!=" and not "! =". It kind of helps my brain elevate the code from "sequences of characters" to "serialised syntax tree".
The fact that the "not equals" operator is the exclamation mark followed by an equals sign is purely an artefact of the practicality of keyboard input. Ligatures are a simple way of stepping away from the raw text and into the meaning of things, just like syntax highlighting helps transform "words" into "tokens" on our brains, or rainbow parens help us visualise the hierarchy of the language in question.
(Though I find rainbow parens a bit too colorful and distracting, so I don't use them in practice, I like the idea behind them)
It is the same idea that proponents of visual coding advocate for, but text as a medium is much better because of how compact we are able to make it without feeling cramped.
Which leads me to another tangent, which is that there is a very clear split between programmers that "manipulate text" and programmers that "manipulate structure".
It can be seen in the choice of tooling, some people really go ham with multi-cursor editing, find-and-replace patterns, "select next word", editor macros, and other text manipulation based tools. While others (myself included) prefer a more content-aware tool like JetBrains' "rename field", "extract method", "widen selection" (select AST parent's text span), etc.
Which is not to say that either group is more correct or efficient, it's just a pattern I see on people.
As someone in the second group the IDE is basically just doing the first thing efficiently for you when you do the second thing. Not a good or bad thing but I do think that that’s interesting to note
I'm in the first group (these are text files first and foremost) and I think that's a really interesting observation. Do you have any thoughts on what the consequences might be?
Can only speak of experience writing code for both groups and seeing them work, don't take any of the info below as statistical truth.
As I said before, it certainly affects the choice of tooling, and therefore this property of programmers often places them in either side of the eternal "IDE vs text editor" wars. Which is distinct from the GUI vs TUI wars, but in practice most IDEs are somehow graphical. Structure-ers generally prefer tools to be thorough even if they're slow, while Text-ers prefers tools to be as fast as possible so they can be thorough themselves.
I don't think there is really that much of a difference in code style, the general pains of weirdly styled code are often universal regardless of how you look at it. (Text-ers might dislike identifiers with multiple words because it takes longer to navigate through, while Structure-ers might dislike having complicated expressions for the same reason.)
I guess the main impact I see is from pair programming, it is supremely distracting to watch someone with a different mental model of the code do things in what appears to be this "inefficient" way.
As someone who manipulates structure, the refactoring tools and the like, as well as the formatting IntelliJ does for you, make my programming less portable between editors. Text-driven development is very portable, but I actively dislike using VSCode in comparison to IntelliJ because it refactors and formats code in different ways.
I have nothing to add, just wanted to say I think this is the best-written explanation I’ve come across for why I like both ligatures and good syntax highlighting.
It took me a bit to warm up to them, but now I find myself relying on them to more quickly spot errors, so yes it ends up faster. Somewhat counterintuitively, I find the ligature characters easier to process at a glance and see if there's a problem or not (I suspect its something along the lines of my brain looks at "<=" as two separate characters, one after the other, and has to process each in serial then combine them into the concept of "less than or equal to", whereas the ≤ is a single character that goes straight to the "less than or equal to" concept in the same way its easier to remember the number "six hundred ninety-three" than "six, nine, three". I also find it way easier to spot the "≡" vs the "===" in JS land, which surprised me but here I am.
I wouldn't say its harder to go back, but it does make me do a double take. Overall I would say the effect is quite minor and I'm just fine without the ligatures, but given the option I would enable / prefer them.
Ligatures became one of my favourite features after trying out Fira Code. It felt like an obvious improvement that I was yearning for, for years.
I guess my brain likes having distinct continuous symbols to represent different operations - it reminds of of math in school & university. And I don't see a problem during editing, knowing they're made of multiple symbols.
And yes - I feel that I do struggle much more without them.
Completely out-of-the-blue, unproven guess - my mind is used to learning new symbols quick, from all the gaming I've done. And it's much easier to learn a new symbol that's cohesive, continuous & unique, rather than having to read disjoint characters and figure out a different meaning for them.
I find ligatures more interesting for the slightly more "exotic" syntaxes like arrows → instead of ->, ⇒ instead of =>, etc. Most of them are incredibly similar to their non-ligature counterparts, and even ones like != don't seem to cause much trouble.
I don't seem to have any trouble switching between ligatures in the IDE and no ligatures on github. I haven't really had to think of them.
I initially hated ligatures. Decided to give them a try with JetBrains Mono.
Now when they are turned off I feel like something is missing, and scramble to turn then on again. For whatever reason my brain feels more comfortable with them.
Coming from a math background and using latex a lot, ligatures were really godsend for me. Without ligatures code looks unnatural but it's just an aesthetic thing in the end and I don't mind either way
I also can’t use ligatures. In my head it’s two symbols and to see it as only one just complicates it. But I also feel like if you had a language and it just supported a Unicode symbol then I’d be fine with it. I think it has to do with the fact that I know / sense the facade and it causes me to always resolve it to its two character canonical form.
if you see the <= "less than or equal to" ligature and hit backspace once it will become <. it's very intuitive. this is how emoji operate to combine a face with a skin tone - it is two characters merged into one.
dunno why so many people see ligatures and clutch their pearls like it is some kind of rock and roll devil symbol.
I think people don't like it because it's not intuitive. When I hit backspace next to a character, I expect the character to be deleted, not for it to shapeshift into another character. I see how ligatures can be nice for some people, but it's definitely not as intuitive as showing the actual characters in place.
Also if I type two characters, I expect to see two characters - and not a single character that is somehow not aligned with every other character's columns. And because it is not aligned, the space left and right seems to be off. Everything about monospace ligatures feels unintuitive to me.
I tried to get used to them, but eventually gave up when I found that I was getting ligatures for parts of runs of symbols when they weren't actually appropriate. I think it was `|` and `>` placed next to each other that pushed me over the edge.
i don't think of it as faster or slower to read, it's just more aesthetically pleasing to me. i use cascadia code in vscode with ligatures enabled, it's really nice looking.
I initially liked them, but later changed my mind. The same goes for e.g. prettify-symbols-mode in Emacs or conceal in Vim, which takes the same concept further.
I often work with files (both documents and code) where Unicode input is permitted, and it can then be important to know what exactly is written in the file. Fancy ligatures make this ambiguous.
I would also advise against ligatures in terminals, as it can mess up some text-based interfaces.
I just think they are pretty to look at while coding. I have to stare at code for long stretches of time. It's easier to do so when things are aesthetically pleasing.
I guess looking at font that doesn't support ligatures does become a little bit harder, but I can't imagine the switch being too time consuming.
I've been using JetBrains Mono for years now. It's great.
I have the opposite experience with ligatures owning to years reading academic mathematics papers before coding seriously. I can still parse semantically dense symbology significantly faster than most code (even with years of experience) to the point where code seems almost comically inefficient. That said, I know many programmers take the implicit context intrinsic to mathematics symbology as often times an inexplicable cognitive load.
If you have a lot of different symbols, it makes sense that ligatures would help to distinguish them more easily. So, ligatures for Haskell symbols also probably help, since there are so many infix operators in Haskell. There are also a bunch of old papers that showcase Haskell code and use the ligature representation of its operators.
However, most programming languages really just have a few symbols: arithmetic operators (+, -, /, *), comparison operators (<, >, <=, >=), and logical operators (&&, ||, !). C also has bitwise operators (~, &, |). It's already easy enough to distinguish these without ligatures, so the benefit is negligible here, IMO. I prefer to go without ligatures, because I have no trouble remembering or distinguishing them, and, like someone else mentioned, I find ligatures in a monospace font kind of weird (how they morph into a two column character when you write them, and turn back to a one column character when you delete half of it).
I see a lot of folks in this thread lamenting the usage of ligatures, but note that the downloaded set of font files includes a "JetBrainsMonoNL" version of all variants, which does not include ligatures ("NL", as in, "No Ligatures").
I do not like ligatures either, yet this is my favorite monospaced font. I use JetBrainsMonoNL in all the places.
I'm starting to wonder if this is becoming spaces vs tabs. It seems silly to heavily critique a font because it supports ligatures and inversely seems silly to critique a font because it does not.
Most fonts with ligatures can be used without them anyway, making the whole thing moot
However, not all IDEs, text editors, and terminal emulators support disabling the use of ligatures, so it's often easiest to just switch to a font that doesn't include them if you don't want them.
huh, I'm surprised from searching that there isn't a quick tool to just disable ligatures given a font file. It should just be a matter of removing the ligatures in the GSUB table from the font.
Doesn't that depend on the font author providing a NL version?
e.g if you want the FiraCode improvements[1] over FiraMono without the ligatures. Without editor support, you would have to build it yourself since they don't distribute a NL version.
That's what I mean; it's often easier to use a font that doesn't have ligatures (like the NL variant) than to use a font with ligatures and hope your editor lets you disable ligatures.
I like ligatures but only when they help to remove ambiguity. For example, the ligatures for “=>” (⇒) and “>=“ (≥) are helpful because they make a syntactic problem visually prominent with how different they look. Any ligature that doesn’t help you be a better code reader is a useless visual artifact, a distraction even.
There are a lot of code fonts on HN today. Rather than make a new post I will talk about some of my favorite that are a little less common. None of these are free I don't think.
Cartograph CF - The one I've been using for code for years. Very readable, almost "comic mono"-like choices of some of the lower case glyphs but in a good way. All the character is in the italic which you will either love or hate.
Quadraat sans mono - The entire quadraat family is a collection of masterpieces imo, but are generally too distinctive to be appropriate for most public-facing work. But it's your computer so who cares. I use the mono sans one for my terminal. The lowercase f seems so out of place there but you learn to love it.
Alegreya sans - Not a mono font, but it almost is so if you've ever flirted with proportional fonts for code this is a fun one to try. There is a lot of careful line width variation that gives a lot of the appearance and readability advantages of serifs but keeps most of the visual coherence of sans.
I like all of these because they feel more like normal fonts rather than code fonts. They have careful variation that adds character and improves readability for me. I've switched to an almost-no-color code theme that uses font weight instead, and the details like this become more important that way.
And then only kind of related but if you want to use unusual fonts in your terminal but you have a complex prompt setup, install font forge and learn to use something like https://github.com/ryanoasis/nerd-fonts/blob/master/font-pat... to patch in the extra characters. This can also solve your "I love this font but want a dotted zero" type problems as well. Small skill investment for a small return over a long period of time. You'll always be using fonts.
It does look good but oof I dislike the cursive italics. I find cursive hard to read, since I never really learned to write it, and I constantly trip over letters like "s" and "r" that don't look liker their normal counterparts.
For me nothing can dethrone Inconsolata[0], there's just something elegant about it that I haven't found in other fonts I've tried. Been using it for almost ten years now. Also I don't like ligatures...
Ligatures are optional, so you don’t have to let the existence of those glyphs stop you from using an otherwise-better(-for-you) typeface. Additionally, in VSCode at least, there are extensions that give you even more contextual control.
Funnily enough I think recently I had to do something in Rider (the IDE) and everywhere in the file where I had a "g" it got cut off somewhere on the last 1/3 of the letter. It was a visual bug that disappeared after restart, but it also made me notice the "g" in a bit more detail. I attribute this to the fact that of all the Latin letters lowercase "g" is by far.. should I say "fanciest"? I can see how the loop tail variation might seem out of place.
In my eyes, Liberation Mono is still the best programming font, due to how readable it is even in smaller sizes (and it comes with LibreOffice I think): https://en.wikipedia.org/wiki/Liberation_fonts
After that, I rather enjoy PT Mono, except that the full stop (dot) symbol feels too small, I actually use the PT Fonts for most of my personal webpages because they're decently readable and not too stylized, nor too boring: https://en.wikipedia.org/wiki/PT_Fonts
But frankly, there's a lot of good fonts out there and it's entirely a matter of taste. Some like ligatures, some don't. Some like monospaced fonts, others like proportional ones.
It's also really cool when the OS itself lets you set your font preferences for most applications that you're going to use, I catch myself wishing it'd be easy to do that for all of the JetBrains IDEs and other dev tools at the same time, though. Maybe a simple GUI program or a script that'd let me set those particular preferences for all of my editors in one go.
For me the best part was the image comparing various letters that look alike in other fonts (and that are removed in Crockford's Base32 precisely due to this):
Is there really a better typeface than Apple's San Francisco Mono? I use it on all my machines, even my Windows and Linux ones. There are also versions with patched glyphs so you don't get boxes when trying to render certain characters.
Yep I use this one everywhere I can on my Macs, and Roboto Mono as a decent approximation everywhere else. Discovered it because I accidentally opened something in XCode one day and went "wow, that's a nice font!"
Nothing beats Iosevka (https://github.com/be5invis/Iosevka) for me. It's narrow yet super readable, making great use of screen real estate. Lots of customization, ligatures, weights, and a nerd font patch for terminal.
Oooh, that does look great. Very similar to JB Mono, but I like the defaults in Commit Mono a bit better overall. The asterisk, the positioning of the quote marks, the slashed 0 instead of dotted.
I never actually understood the whole fuss about fonts.
I tried playing around with them few years ago and i never noticed that something is easier to read with some font or another, especially in the long term. Whenever i started using some font, i got completely used to it in few days. Therefore i just use the default fonts now.
To each is own but I'm a huge design and typography nut and when my entire physical workspace and software interface looks aesthetically pleasing, I'm much more inclined to actually do work.
Monaco is very good and, to me, the way Monaco does the lowercase 'l' letter is the only proper way to do it. Several other coding fonts thankfully get the lowercase 'l' right, like JetBrains Mono btw.
This, and Roboto Mono, are my two desert island monospace typefaces. Are you allowed to have two desert island mono typefaces? I don't think I could could choose between them.
Not a fan of the ligatures, it's a pleasant looking garnish that requires translating to its underlying parts. So it would probably work for one person but butb not so great when sharing screen time with others, then it just becomes a distraction.
I personally prefer classic "typewriter-style" monospace fonts - "sans-serif" monospace fonts always look unbalanced to me, because they avoid serifs as much as possible, but then are forced to use them to avoid thin glyphs like i, j, l, 1 etc looking "lost". Unfortunately the designers seem to focus on sans-serif anyway. One good contender with serifs is "Go Mono" - it also uses the trick of increasing the height of lowercase letters to be more readable at small sizes, and it notably doesn't have ligatures. It also doesn't have a fancy demo page, but here's the blog post introducing the Go font family: https://go.dev/blog/go-fonts
JetBrains Mono is nice, but it's a little too sharp, and it's too tightly packed IMO. Cascadia Code is a little better, but nothing beats Menlo for me.
I greatly appreciate Jetbrains' software. But the only thing that I care about in a code font is balancing legibility with maximizing columns of text. Their overlay comparison to consolas fails on my main concern.
Absolutely the best font I’ve ever used. I can easily read letters from far, from close, in bright light, in darkness.. used it since day one. Also using it in my terminal. Thanks JetBrains, I love it.
While now there are many other good typefaces for programming languages, which are more or less equivalent to JetBrains Mono when restricted to the ASCII character set, JetBrains Mono has much better coverage of various Unicode blocks, e.g. of the mathematical symbols, and this is why I normally prefer it.