flag of the United Kingdom
URBAN
Mainframe

Fonts for Programming

Date:  Wed, 6th-Oct-2004prevnext

Tags: Programming

An interesting little item popped up on Forever Geek last week (1st Oct, 2004) entitled, "Fonts for Programmers".

I work with source code (or plain text) all day long, be it Perl, C, JavaScript, PHP, (X)HTML or CSS. It stands to reason that I should give serious consideration to anything that would make my work easier or enable me to be more productive.

I have put together a software library that makes program development a breeze and I have invested heavily in hardware and reference materials. I have refined my tools and resources over several years, always with productivity utmost in my mind. Yet never once did I consider the impact of the font I use to do my work...

“almost anything's better than Courier”

Programmers have certain requirements of a font:

  • mono-spaced (fixed pitch)
  • full ASCII Character Set
  • visual differentiation of the characters "1" (one), "l" (lower-case "L") and "I" (upper-case "i")
  • visual differentiation of the characters "0" (zero) and "O" (upper-case "o")

Additionally, the font should scale well - it should render pleasantly at various point sizes.

I suspect I am not alone in that I used a Courier variant as my fixed-width font by default. However, the "Fonts for Programmers" article prompted me to reconsider by recommending the "Anonymous" font.

Anonymous is an extremely nice font. It looks great on screen and prints nicely too. Unfortunately, I don't like the way it renders "#" (hash) or "~" tilde - both of which make frequent appearances in Perl source code.

Thus I found myself on a quest to find a decent font for programming. I finally settled on "Bitstream Vera Sans Mono", a great alternative to Courier.

Bitstream Vera Sans Mono font preview

I am extremely happy with my choice. Bitstream looks great, is easy to read and prints nicely. The troublesome characters (1, I, L, 0 & O) are very distinct from each other and thus easy to tell apart.

Typography preferences are very subjective though and Bitstream might not be right for you. But almost anything's better than Courier!

You can comment on this entry, or read what others have written (5 comments).


W3C VALIDATE XHTML
W3C VALIDATE CSS