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.

Get them delivered!

If you enjoyed this and want all the latest articles delivered to your inbox every month, pop your email in the form 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. Respecting people’s privacy

    Collecting data, whether needed or not, is high on a lot of companies’ agendas. Me, I don’t track users and I collect the bare minimum data.

  2. Accessibility issues when removing list markers

    If we remove the list markers from an ordered or unordered list, we’re likely to run into some issues with VoiceOver.