Skip to main content

Ligatures in coding fonts

Posted in Development

In the same way I enjoy trying out a new text editor every now and then, I do the same with my code colour scheme and font – a change just freshens things up a bit.

For a long time, I’ve used Mozilla’s Fira Mono and have been very happy with it – I have no trouble distinguishing similar characters (0s and Os, 1s and ls), it renders nicely on macOS and is comfortable to read.

But my head was turned by a fork of Fira Mono called Fira Code; it’s pretty much exactly the same but with one killer feature: ligatures. Coding ligatures are the ‘correct’ way of writing operators, for example:

  • != (not equal to) becomes
  • >= (greater than or equal to) becomes
  • => (the JavaScript arrow function) becomes

Using != as an example, you still type two characters, ! and = but Fira Code makes them look like a ; the only difference is that the new not equal sign spans two characters, taking up the same amount of space as the characters you typed. Press backspace once and it leaves you with a !. Nifty.

There are loads of operator ligatures as well as other nice touches like the classic Fl/fl ligatures and nicely joined-up Markdown header ### markers. The Fira Code repo has an easy-to-look-at comparison of all the ligatures it uses alongside Fira Mono.

But I couldn’t get used to it! And I realised I didn’t want to get used to it. I like customisation, but I have my limits, and ligatures feel like they go too far:

  • I’ve been writing ligature-less operators for the longest time so I’d’ve had to effectively re-learn them
  • I’d then be locked in a world where I could only use coding fonts with operator ligatures, which would limit my options
  • Using ligatures for code examples on my website, presentation or video would mean most people would have to work harder to translate my fancy operators back into the ones they use every day

There are plenty of alternatives to Fira Code and as Nikita Prokopov, who made the Fira Code fork, says:

Ideally, all programming languages should be designed with full-fledged Unicode symbols for operators

If they were, I wouldn’t have a problem using them as they’d be universally expected and understood, but until operator ligatures are the norm I’m happy with my boring old unjoined-up operators.


If you enjoyed reading this and want a monthly roundup of my articles delivered to your inbox, just enter your email below.

I don’t collect any data on when, where or if people open the emails I send them. Your email will only be used to send you newsletters and will never be passed on. You can unsubscribe at any time.

More posts

Here are a couple more posts for you to enjoy. If that’s not enough, have a look at the full list.

  1. If HTML and ARIA don’t allow it, it’s probably a bad idea

    I like to use invalid HTML and ARIA as a design constraint; a line I can’t step across. Sounds obvious, but in practice it’s not always that simple!

  2. Mac event 2021

    Apple had their final event of the year last night and it was especially exciting as I’m in the market for a new Mac. Here are my thoughts.