Quick Tip: Modern Arrows in your Editor

Matt Eland
Nov 13 · 2 min read

Let me show you a new trick I learned over the weekend. Languages like JavaScript, TypeScript, C#, and others offer similar syntax for their operators. With the use of font ligatures, you can represent these languages features in a mono-spaced, yet modern format intended for programmers.

Since a picture is worth at least 42 words, take a look at the following code:

Notice the use of the => operator for arrow functions? Now take a look at how this renders in my development environment (Visual Studio 2019):

See how the arrow functions now literally appear as arrows? This little bit of extra flair is a delighter that reinforces the use of these modern operators.

This isn’t just limited to arrow functions, however. Take a look at these other operators:

What I love about this in particular is how the equality statements render. In JavaScript in particular, this helps you quickly spot the difference between == and === which can be the difference between spotting a bug and missing it.

So, how do you get started with this?

First, install the Fira Code font by downloading and installing a font from its GitHub repository. You should be fine to only install the regular variant, but you could install the others if you wanted.

Next, open your favorite editor’s font dialog and change your font to Fira Code.

Finally, close the editor and restart it. This will ensure that the ligatures I described above are enabled. This may not be necessary in all development environments, but it is in Visual Studio.

And that’s it! You should be good to go.

Hopefully this modern take on our language features delights you as much as it does me. Personally, the added degree of polish makes me feel just a bit more awesome and capable.

Let me know what you think or what other techniques you use to stay awesome and productive in your editor of choice.

Originally published at https://killalldefects.com on November 13, 2019.

JavaScript in Plain English

Learn the web's most important programming language.

Matt Eland

Written by

Matt is a front-line .NET and JavaScript software engineering manager. Matt writes frequently on software quality at https://www.KillAllDefects.com

JavaScript in Plain English

Learn the web's most important programming language.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade