Computer programming: Why coders use Courier and other monospace fonts.

Why Do Programmers Use Courier Typeface?

Quora
The best answer to any question.
Dec. 23 2013 1:29 PM

Why Do Programmers Use Courier Typeface?

1387822921
Coding in Courier 12-point font.

Screenshot courtesy of Code Project's Font Survey

This question originally appeared on Quora.

Answer by Leonid S. Knyshov, CEO of a customer referrals startup, consulting product manager:

Advertisement

We use monospace fonts to keep code aligned.

Courier is just one of many monospace fonts. They are also called fixed-width fonts. Consolas is the default font in Visual Studio, and there are even better fonts for programmers.

We like fonts where:

  • 0 cannot be confused with O
  • Punctuation characters like "," are bigger because they are far more important in programming than in daily use
  • Brackets are distinct
  • "1," "I," "l," and "|" cannot be confused (that is 1, i, L, and the pipe sign)

This leads to fewer bugs. Mistyping "," as "." will often break your code and at least lead to unexpected behavior. The same is true for ":" versus ";" and so on.

More questions on Computer Programmers:

  News & Politics
Politics
March 31 2015 5:00 AM How the Founder of the Fugees Became a Big-Time Political Donor Without Anyone Knowing The musical artist chose to fund a super PAC through opaque, legal, and increasingly popular means.
  Slate Plus
Working
March 30 2015 11:32 AM The “How Does a U.N. Official Work?” Transcript What’s it like to manage the U.N.’s Ebola response? Read a transcript of Adam Davidson’s conversation with the assistant secretary-general for field support.