Whether you are making web pages or writing scripts, you will be typing a great deal, making it vital that the font you choose to display your code be both legible and easy on the eyes. Most of the simple coding issues that people make are due to typos: if you can’t read what you type, you’re going to miss errors.
Historically I have used Arial Narrow to display code samples in class, which had the advantage of being available on almost every platform and capable of fitting many characters per line, together with fairly high legibility. Recently I’ve transitioned to using other fonts: typefaces in the list that follows are all free, monospaced (which makes tab-indented lines easier) and cross-platform (important when moving and maintaining your code).
Currently my go-to monospaced font in Windows. Designed by Lucas de Groot, Consolas is freely available on every copy of Windows since Vista. The font is optimized for ClearType (and thus for LCD screens) and very easy on the eyes. With a little work, it is possible to install the Open XML File Converter to have Consolas working on Mac OS X, along with all the other fonts introduced in Vista (all of which, oddly, start with “C’).
The native Mac OS X equivalent to Consolas, which can be downloaded for all platforms. Like all the other fonts in this list, it uses a “slashed” or “dotted” zero, which distinguishes the numeral 0 from an uppercase O letter.
Inconsolata is a free font closely related to Consolas. Designed by Raph Levien, an engineer on Google’s Web Fonts team, it is part of a number of other fonts he has developed. Inconsola is used to set code samples in this blog.
If I have the ability to install fonts on the machine I’m using Anonymous Pro is my current preference for coding. Mark Simonson’s page also has excellent guidance for using the font on different operating systems and applications. (I also use Anonymous Pro as the font for displaying code samples on this blog).
Proggy is a free bitmapped monospaced font. As such, I wouldn’t personally use it for coding per se, but it could be very useful in a shell, or when you want to make text look like code for the purposes of screenshots or mockups.
Source Code Pro
A fork of Adobe’s Source Sans, an open-source type family. Six different weights, regularly updated, highly customizable; another fork, Source Code Pro L, uses ligatures for operators. Available on Github, Google Web Fonts, and from other providers.
A very well-supported typeface with roots in the Bitstream Vera and DejaVu projects, hack has an excellent character range (over 1500 glyphs), and many different weights and styles. It's even supported as a web font, with its own Content Distribution Network for use on site code samples. Download Hack.
Another Github-hosted project, with support for over 500 symbols.
Droid Sans Mono
Finally, there is Droid Sans Mono, a monospaced version of the Droid font used on Android devices.
There’s no need to use the defaults (like Courier) that DreamWeaver gives you!