Ligatures, IMO, make for a bad coding editor experience. No, I do not want >> parsed as a right shift when it's actually used as two adjacent template delimiters. And no, I'm not okay with the inconsistency that results from the usage of different operators from one programming language to another. Want to change a != to a == operator? Enjoy futzing with placing the cursor properly. It's a cute idea, but I found it more annoying to use in practice.
To each their own. I have never found them confusing or annoying in a half a dozen languages. If it doesn’t improve readability for your brain then definitely turn them off. In a language like Go or JS there aren’t very many operators so it’s not as bad as C might be. Still a great font without ligatures
> No, I do not want >> parsed as a right shift when it's actually used as two adjacent template delimiters.
I don't like ligatures either, but I think that this depends on the editor. For example, if typing Rust in IntelliJ, if you type `Box<Box<String>>`, it will show two regular ">" characters. But if you type `x >= 3`, it will replace it with a single glyph.
But, to your point, it would seem it doesn't enable ligatures based on the parser, since there is a difference between ligatures active and disabled, and it applies on both lines.
Not who you asked, but I use dark mode in VS Code and Sublime usually. But those are the defaults. I do use default fonts. I generally don't change defaults.
However.
If ligatures were turned on by default, I would turn them off.
Ligatures seem like the light theme in your analogy. I do NOT want my code looking one way in the editor, and another when reading PRs on the web. Consistency is king, and this just feels like bells and whistles some designer came up with.
Same reason one uses spaces over tabs, except in Makefiles because someone decided tabs are mandatory. With spaces copying the code from one place to another doesn't change the indentation too much.
I'm sure I would get used to it after a while, but right now I'm having trouble even reading the examples. I don't need my editor to be too special.
> I do NOT want my code looking one way in the editor, and another when reading PRs on the web.
Some PR tools let you select your font. I think more should.
For one example on the web today, you can use github.dev (shortcut '.' on the github.com page for the PR) to open GitHub PRs in the web version of VS Code, which will Settings Sync, including font choice, with your regular VS Code profile. (Though, of course, that uses the GitHub Issues and Pull Requests extension to provide PR tools, and you can also just install that same extension locally into VS Code and never visit the web in the first place and just use VS Code for PR reviews if you like.)
Sounds cool, but I'm comfortable in vim. I'm curious though, what black magic does it use to sync the web to my local dotfiles? Or does VS Code have cloud accounts now?
It does support a cloud-based sync tied to either your GitHub account and/or Microsoft account.
If you prefer a more traditional git-based dotfiles sync, github.dev and GitHub Code Spaces will also look for a public or private repo under your account called dotfiles.
I don't think vscode.dev has a way to provide a dotfiles repo, though, and I think it only supports the cloud sync. (vscode.dev is the other web hosted VS Code like github.dev but for other generic things like its Theme Playground and a subset of github.dev functionality for Azure Repos missing things like PR review support because there is no equivalent extension to GitHub Issues and Pull Requests for Azure Repos.)
So what you're suggesting is vendor lock-in to solve my goal of consistency independent of context? What about Gitlab, Slack, mailing-lists? And the killer feature for losing that is ligature support?
I do have dotfiles repo but no VSCode stuff there, and no Microsoft account, might explain why I never got past the "setting up your web editor" screen when I tried the '.' shortcut.
I'm not suggesting vendor lock-in is necessary which is exactly why I mentioned there were multiple ways to do that. I think it is great to have options.
It was also just one example I knew of where code review tools were getting more respectful of user preferences. I stated pretty plainly that I wish a lot more tools were doing that beyond the examples that I knew. I'd love to see more font options in code review tools.
I don't know about Gitlab and the last I used Slack I had wished it had font options because I hated whatever fonts they chose that they thought aligned best with their brand. Mailing lists are actually an easy answer: use a mail client that happily lets you switch an email's fonts. (I used to do that when reading code in mailing lists in Thunderbird to switch from the default proportional fonts of email to a monotype font and back. I assume Thunderbird still has features like that, but it has been forever since I've personally been on a mailing list involving code reviewing.)
Of course I realize I can change the font? We can do pretty much anything we want if we put the energy in it. I already do in my WM, terminal, vim, mutt and everything else on desktop. If I really wanted to I could replace the font in code and pre block as well with just a few lines of css in a user script, but ligatures is not the feature that will make me do it. Maybe to remove them, that would be an idea if they become mainstream.
You're missing my point, I don't want to have to set a special font for everything I use. Simplicity and minimalism is my way. Not VSCode + Microsoft account + github.dev, I have no use for either. I could do it in my current tools, until a client uses something else, and I would have to set it up again. Or maybe I'm in a VM, not logged into github.com and reading some repository.
The ancient Python maxim is "Code is read a lot more than it is written" and I've always found that to be true. Looking nice is a benefit to readability. Readability is a key part of maintainability (you have to find what you are about to edit first). I find that I'm more likely to catch simple mistakes with ligatures than without, which is also a boon to editing/maintainability. (For example of that, in JS/TS development Fira Code's === ligature isn't just wider, but has an entire third extra line in the vertical stack, making it in my opinion far easier to spot.)
Exactly. Personally I like to have it very obvious exactly what characters are in my file. But I also do agree that it looks very nice and can appreciate why people prefer it.
You can generally configure that in your viewer/editor on if to use ligatures or not, separately from the font itself... but if it isn't in the typeface, you don't even get the option if you do want it.
They're definitely polarizing, in the sense that some people intensely dislike them and never use them, others love them and always use them.
It reminds me of the debates about font antialiasing back in the 1990s. A vocal minority of programmers then insisted that font antialiasing wasn't suitable for coding, as a pixel-oriented monospace font (e.g. Monaco at 9 points) provided better text density and better readability[1].
Then, like now, I could see the validity of the arguments of both sides. Readability is a highly subjective thing (and also varies over time, even for the same person). And the screens and antialiasing algorithms of the day weren't as sophisticated as what we now enjoy.
Personally I waffled on it for a while, but now I always code with ligatures enabled in my main work (which is predominantly using TypeScript and Rust, so the default ligatures of these fonts make sense).
I suspect that the majority opinion will shift to using ligatures for coding (if it hasn't already) once that is the default experience of most editors with the default fonts, and it becomes something you have to turn off, rather than turn on.
[1]: This is an example of Monaco, although what they show as 12 point is how I remember 9-point looking... not sure if my memory is faulty or what, though, it was a long time ago. https://www.fontriver.com/font/monaco/
Idk, my editor/terminal disables the ligatures when my cursor hovers over them, so that's not a problem.
It's absolutely a personal preference thing, and I personally prefer it. At least for the languages that I typically work with. I could see it being annoying with certain languages.
My biggest problem is that despite them supposedly being supported by windows 10 I can never get it to work correctly even on totally fresh installs. I’m 0 for 5 at this point. If someone has the magic that actually fixes this, please share. (And yes I enabled utf-8).
Also kinda meta but I see three different font related links on the homepage right now? Just coincidence?
It's often a separate configuration option in various editors... I know you have to enable it explicitly in VS Code, for example. It's not on in applications by default.
I never found it hard to edit code with ligatures when I used them. I don't use them anymore, but I don't understand some people's need to shout about how bad they are. Don't use them if you don't like them, use them if you like them, simple as that.
Although what did you expect, since there isn't much else to discuss about fonts that isn't subjective. We could discuss slashed vs dotted zeros, I guess.
When downloading Berkeley Mono, you can choose some configurations and I love the slashed 7 (as well as zero). Something feels off to me with the line but overall it’s fun to have in a font.
I use Cascadia Code PL Nerd Font. What do you use?
I would like to learn how most people decide on choosing a monospace font for their code editor and terminal. Is it pure choice based on looks? Or some other things are considered?
As long as there's something to distinguish zero from a capital letter O. I'm okay with the dot. I wish most typefaces made 0 more distinguishable from O.
Ordinary glyphs and ligatures (if any) are generally thought to be designed together. Turning ligatures off is not a proper solution but a workaround---you would be using something different from what was originally designed [1]. And sufficiently many people think most uses of ligatures in programming fonts are indeed bad, therefore those fonts are also bad, thus endless complaints.
[1] And if ligatures are designed independently from ordinary glyphs, there is no reason to make them default.
It's a monospace font. Ligatures aren't used to make sequences like 'fi' look stupid, they're used to make sequences often used for mathematical operations look like those mathematical symbols. Turning off ligatures should be completely fine in this case.
Given how many choices there are for monospace/coding fonts, it seems hardly worth making a fuss over. Use it if you like it, use something else if you don't.
Of course, this is all very subjective, but I do find Fira Code to be a beautiful coding font. I also appreciate having ligatures in fonts nowadays. Fira Code was my go-to for a long time, but I've come to increasingly use Jetbrains Mono which is available under the same Open Font Licence and is quite similar (although slightly preferable visually to me).
I'm having trouble finding it now, but at one point I used a tool that put monospace fonts head to head (without revealing their name) and you would choose what you thought looked best. Jetbrains mono was my winner and I've been using it ever since.
Can't explain it, but to my eyes Jetbrains Mono is too robotic or mechanical, maybe clinical? whereas I love that Fira has some character and feels at least a bit Humanist for a monospaced font. The iA Writer fonts are another great option.
I've tried ligatures in coding for a few months but eventually decided against them. The small parsing overhead isn't worth it just for beauty. The philosophy of form follows function wins again.
For me ligatures improve readability which surprised me after two decades of not having them.
I think it’s because operators like != are actually considered a singular symbol not two characters. We just don’t have that many available keys so we use multiple characters. But in my mind it’s a single symbol and ligatures go a long way to help my brain parse it that way
> Your eye spends a non-zero amount of energy to scan, parse and join multiple characters into a single logical one.
I don’t know how many calories are expended by the brain to perform this, but it has to be near-negligible.
I am _extremely_ used to seeing characters as they are in ASCII, and retraining myself for some infinitesimal savings in visual processing seems like a net negative.
Maybe this is useful if you grew up with them? By all means do whatever you want for your own env.
I'm pretty sure the eye spends exactly zero Joules on interpretation of visual stimuli.
As for the brain, the brain doesn't see characters at the perceptual level, that it then needs to join at the cognitive level into tokens. At the perceptual level it just sees shapes. Whether it takes more energy to parse != or ≠ is something I don't anyone has ever researched.
it does involve energy though, which was the original premis. Now whether total number of joules consumed over <> vs != vs ≠ is the real debate and gonna be hard to study I think...
Yeah, I read words all day and don't think my reading would be significantly improved if I started communicating in Chinese and read kanji. I'm sure one language is easier to read than the other but I doubt it is because their symbols are distinct per "word". I suspect that English readers don't read every individual character but rely a lot on word shape and I also suspect that people reading kanji do take some effort parsing particular features of the characters. I doubt there is a major fundamental difference.
> Your eye spends a non-zero amount of energy to scan, parse and join multiple characters into a single logical one.
Is the implication that with FiraCode, the eye will finally spend zero energy on scanning, parsing and joining glyphs? Finally, after all these years, a perpetual motion machine! :-)
I think I have been using FiraCode now for about 8 years? Something like that. Ligatures are the best thing ever. Some of my co-workers don't get it. I can digest code either way, but prefer the concise and crispness of ligatures.
Coming from a life time of Visual Studio, when changing to Rider, the first thing I did was to change the font to that of VS. I can't quite explain it but reading the code in the Rider default font (which I believe is JetBrains Mono) made me feel nauseous/queasy.
I like Fira Code very much. I've been using it as my font in all editors and terminals for... 5? years now. Ligatures enabled in editors, ligatures disabled in terminals.
I want to say thank you for your efforts as well. Been using Fira Code for about that long myself. I also do like Consolas/Inconsolata and Cascadia/Caskaydia Code as well, but always come back to Fira Code for editing.. the extra spacing is just easier to grok for code imo.
I don't think the idea behind ligatures is all bad, but I think font is just not the best layer to implement the concept. What I really would want to see more of is fully typeset code. Fortress had the ability to typeset code with TeX, but that was afaik not editable. Something in that vein would be great imho. The community being so fixated on monospaced fonts is imho holding code readability back a lot.
It has a more stylized look than your typical coding font, and I don't use it all the time, but I enjoy swapping it in when Source Code Pro starts to feel a bit boring.
Used FiraCode for a while, then switched to Victor Mono [0], but found myself going back to Cascadia Code [1]. I can't seem to be able to get along with fonts that are too thin it seems.
" Ideally, all programming languages should be designed with full-fledged Unicode symbols for operators, but that’s not the case yet."
One (minor) language that does have quite a lot of support is Rakudo which allows both unicode and ascii equivalents for many operators.
https://docs.raku.org/language/unicode_ascii
Agda embraces Unicode. PureScript & Haskell (with the UnicodeSyntax extension) both behave pretty well with a lot of Unicode operators (but rely on bicameral scripts as the leading character for deciding if something like a value or a Constructor/Type). Not sure of its status, but ocaml-m17n is a way to get some Unicode support in OCaml which otherwise can’t deal with any of it.
Agda goes above and beyond that when you consider their mix-fix syntax…
While it might not be perfect, it’s a hella lot closer to mathematical proving/programming with normal functional programming “constructs” (for lack of a better word… idris etc, also the struggle with sized types)
Last time this came up I really got value out of https://www.codingfont.com/ to compare fonts in a tournament style until I found a font I liked. Years later I'm still happy with my font selection. I consider this passing it forward.
Edit: There is annoying popup, but click away from it and you can do the thing.
I like trying different coding fonts, and I like FiraCode for its aesthetic qualities, but I don’t use it because it’s a bit too heavy visually for my taste.
My favorite coding font is the Go font. It’s very readable and brutally simple.
This is clever but obfuscation at the rendering layer is a thing that has bitten me enough that I can't get behind it or recommend it to anyone. Clever though. I think maybe some thought could be put into the font beyond the ligatures too. Keep up the good work though, people should be making more experimental fonts. Typography is so foundational to everything we understand as humans in this post post-modern world but also... you know.... since cuneiform. So while practically I think this idea is problematic, I think it's important work and it sparked some thoughts in me.
I used this font for a while, it's very readable, but my brain can't parse ligatures at all. When I'm dealing with !== === == I need to be able see every character and how they line up vertically.
FiraCode was my goto for a while, and it really worked well. I'm pretty sure was my first "real" programming font that I chose deliberately. Though I never got used to the ligatures and I did switch over ComicCode[1], I still remember that font fondly.
To kick start some discussion, I’ve been using FiraCode (with ligatures on) for the last year or so. No complaints, it stays out of the way like a good font should.
I’ll admit I prefer ligatures while working with ML syntax and Lisps, they feel a little wrong(?) when working with C style languages. Is anyone aware of a way to toggle them on a per language basis in vs code?
Having used FiraCode for a long time, I switched to a very customisable font called Input [1]. I really like the narrowest one for my terminal, as this allows me to fit more on the screen in horizontal direction.
I’ve used Ligaturizer [2] to update the font to include ligatures. I believe the ligatures are even taken from FiraCode itself. I wonder how it’s fitting it to the width of a character as it’s much narrower, but still monospaced.
After some time of happily using Input Sans Narrow, I switched to Recursive for programming. Recursive is a variable typeface with five axes, notably monospacedness and casuality. It is the only typeface with continuously adjustable monospacedness AFAIK. There is also a configuration tool which freezes the axes on specified values for every font (normal, italic, bold, bold italic) and may add programming ligatures.
I've been using DejaVu Sans (a proportional font) for a very long time, maybe 10 years, after about 30 years of monospaced fonts. After all we know that they are easier to read than monospaced fonts, tabs or spaces are fixed length anyway so the only thing that I can't do is columns like
a = 1
ab = 2
abc = 3
Guess what, this is equally readable
a = 1
ab = 2
abc = 3
and some code formatters yield this anyway (eg: Elixir's, if I remember well.)
It's a very good exchange: a little feature to miss, much more readable code.
I gave a try to Input but it was not OK for me. I can't remember the details. I'm giving a try to Sweden Sans, from yesterday's HN.
(Assume for the sake of discussion that those arguments are long enough that they need to be on separate lines.)
That's when the proverbial light went on. I thought, "since I'm not using column alignment any more, why not try a proportional font?"
I did just that, and never looked back. If you're not doing column alignment, proportional fonts work just fine.
Where I currently work, most of our code is in Python. We used to use the YAPF formatter with Google's settings that are full of column alignment. Last year we switched to Black, and I noticed something interesting.
Black-formatted code does not use column alignment at all. It uses only indentation, as in your second example and my second example. So it is just as readable in a proportional font as in monospaced!
My current coding font is something I call Trebuchet++. It's based on Trebuchet MS, but with a few customizations that I like for code: a better tilde glyph (the one in Trebuchet MS look too much like a hyphen), a little extra space before and after a dot, and a sneaky trick to make names_with_underscores more readable: I reduced the width that the underscore takes up but extended the underscore below the text before and after it. These last two adjustments fix a problem with stuff like foo_bar_baz.moo_mar_maz() where the underscores are wider than the dot, creating the wrong visual grouping.
I wish I could publish Trebuchet++, but it is based on a copyrighted MS font. Maybe I will contact them to see if they could give their blessing to this "derived work".
In the meantime, if you or anyone reading wants to have a look at it, my email is in my profile and I can send you a copy "on the sly". :-)
I have a couple of other improvements in mind. One is to add a bit of spacing inside parentheses, curly braces, and square brackets, but I'm pretty happy with the font as it is so far.
While I understand why a font's website would behave this way, I don't think making people dowload 1598 (!) lines of fonts[1] is a good idea; it honestly took so long I was wondering what was so special about their font right about when it started to kick in.
I love FiraCode! I was using it for almost half a decade before recently switching to Victor Mono. [1] The ligatures do serve a practical purpose to me anyways. I find they make parsing symbols much easier because the same symbol in different contexts looks different when it means something different. There’s a reason it’s a typography option that’s turned OFF in most editors though, I understand why people hate it.
Also on the list of things people hate… victor mono has joined-up italics! Which I also love. :)
I love this font. Use it everywhere, including ligatures. I guess the ligatures might suck for some languages, but to me they are great almost everywhere (Java/Kotlin/Python)
I like ligatures but I chose to not use them. I pair program a lot with juniors/people less exposed to nerdities and I don't want them to have an unclear experience or having to explain for the nth time "how to do the solid arrow".
In the end, they don't make that much of a difference other than being a small source of aesthethic pleasure. zero impact on supposed readability
I don't see how ligatures make sense for code. For beautiful typography, sure, but not for text you edit with a cursor, etc.
IMHO coding really needs a simple monospaced font. I use Input Mpno with a slightly squashed horizontal spacing, and an almost overlapping vertical spacing.
> * I don't see how ligatures make sense for code. For beautiful typography, sure, but not for text you edit with a cursor, etc.*
Ligatures are just presentational so they don’t impair editing. If you ever try them again and use VSCode, you might like the Disable Ligatures that dynamically disables them for the selected line or cursor position.
Love FiraCode. Have it installed and configured for all of my terminals, everywhere. Even on Windows. In fact, the one customization I've done to my work laptop (that I otherwise leave in it's official, shipped, state), is to add FiraCode.
First time I’ve seen an ad on a GitHub page. Not complaining—it’s great to have sponsors for open source—just observing that there is an image advert. Is this somewhat common? Does GitHub have a policy for this?
Iosevka is nice because it allow customization. I can fix all my little nits or get it paired nicely with a body copy font, & I can fix the big nits like disabling ligature abuse.
For consoles outside my editor, I tend to like Cascadia/Caskaydia Code a lot. There's a Nerd font enhanced version you can use with starship.rs even. YMMV though.
When I was new to coding the ligatures didn't help my understanding but after a couple years I switched to FiraCode and I love it. Very easy on the eyes.
Ligatures, IMO, make for a bad coding editor experience. No, I do not want >> parsed as a right shift when it's actually used as two adjacent template delimiters. And no, I'm not okay with the inconsistency that results from the usage of different operators from one programming language to another. It's a cute idea, but I found it more annoying to use in practice.
I'm not sure how I could make you understand I like having ligatures. I find they make my code easier to read, and I enjoy their presence. Some people like vim or emacs, some vscode, some eclipse or full visual studio. I personally like that there are an increasing number of different interface choices for people to use when coding.
Personally, I'd love to do my coding without a mono-spaced font but most of the world keeps space-aligning things, so that's not going to work unfortunately.
Of course, you don't have to use ligatures, no-one is suggesting we make them compulsory