Fonts and Coding

André Pang is surprised that programmers use the default monospace fonts (like Courier) on their OS to edit their code, and as an alternative listed several alternative monospace fonts for programmers.

I have an even more radical suggestion: ditch monospace fonts for coding entirely and edit in a variable-width font like Verdana or Helvetica. I’ve been coding this way for about 5 years now and won’t use an editor that doesn’t support variable-width fonts, as I almost immediately notice the eyestrain. There’s support for variable-width fonts in moderns IDE’s –Visual Studio.NET has supported it for years(“Fonts and Colors” under the “Environment” option), as has Emacs since version 21 (see the “set-default-font” function).

Pretty much every programmer that has seen me editing in a variable-width font has initially recoiled in horror. “But how do you line things up in your code?”, they ask. Other than code indentation, I rarely need to do that, and for indentation tabs work fine.

Try it for a week or two. Your eyes will thank me.

One Response to “Fonts and Coding”

  1. Scott Cramer says:

    Hmm… If it were anyone else but you Ken, I’d say it was a bunch of bunk. I’ll have to give it a try. If you start coding with a stylus and a touch screen, though, I’m sending the men with the white jackets for you.

Leave a Reply