Programming Fonts

Programming Fonts

One of the greatest things a programmer can do to make development better is pick a decent font to work with. The default on many IDEs is usually boring, ugly, and/or not even a consideration when the IDE was released. I believe it’s up to each individual developer to find and use a font that works best for him. There’s no perfect font for everyone. However, there are features of a font that make it particularly good for certain tasks.

As far as programming goes, you’re going to need a monospace font. Contrary to what most word processors use (a proportional font), programming IDEs should really be used with a monospace font. The reason for this is so blocks of code can be organized easier. Unlike writing a letter or a blog post, programming relies on a strict structuring and a logical ordering of various language elements. Monospace fonts aren’t necessarily beautiful for the casual reader, but that’s why you use different font styles for different tasks. No one is going to be reading your source code unless they’re interested in the development of the application themselves; and in that case, they’d be reading the source in whatever font their IDE uses.

If you’re on a Windows machine my favorite font to use is Consolas. Just make sure you have ClearType enabled, otherwise it will look blurry. If you’re not on a Windows machine that has ClearType, Inconsolata is very similar and works with or without ClearType enabled. Another font I’ve seen used a lot in the Mac environment is Monaco), the default font for Textmate. Other popular monospace fonts are Roboto Mono, Source Code Pro, and Droid Sans Mono.

Besides those few, there are many other fonts designed with programming in mind and Google keeps a list of popular monospace fonts you can use for free. No matter which one you choose, it’s almost guaranteed to be better than the horrible, previously ubiquitous Courier New.

This post first appeared on my old blog on March 19, 2012. It was last updated on August 13, 2016.