Why Do Programmers Use Courier Typeface?

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:

TODAY IN SLATE

Frame Game

Hard Knocks

I was hit by a teacher in an East Texas public school. It taught me nothing.

Republicans Like Scott Walker Are Building Campaigns Around Problems That Don’t Exist

Why Greenland’s “Dark Snow” Should Worry You

If You’re Outraged by the NFL, Follow This Satirical Blowhard on Twitter

The Best Way to Organize Your Fridge

The World

Iran and the U.S. Are Allies

They’re just not ready to admit it yet.

Sports Nut

Giving Up on Goodell

How the NFL lost the trust of its most loyal reporters.

Chief Justice John Roberts Says $1,000 Can’t Buy Influence in Congress. Looks Like He’s Wrong.

Farewell! Emily Bazelon on What She Will Miss About Slate.

  News & Politics
Politics
Sept. 16 2014 2:11 PM Spare the Rod What Charles Barkley gets wrong about corporal punishment and black culture.
  Business
Moneybox
Sept. 16 2014 2:35 PM Germany’s Nationwide Ban on Uber Lasted All of Two Weeks
  Life
The Eye
Sept. 16 2014 12:20 PM These Outdoor Cat Shelters Have More Style Than the Average Home
  Double X
The XX Factor
Sept. 15 2014 3:31 PM My Year As an Abortion Doula
  Slate Plus
Slate Plus Video
Sept. 16 2014 2:06 PM A Farewell From Emily Bazelon The former senior editor talks about her very first Slate pitch and says goodbye to the magazine.
  Arts
Brow Beat
Sept. 16 2014 1:27 PM The Veronica Mars Spinoff Is Just Amusing Enough to Keep Me Watching
  Technology
Future Tense
Sept. 16 2014 1:48 PM Why We Need a Federal Robotics Commission
  Health & Science
Science
Sept. 16 2014 1:39 PM The Case of the Missing Cerebellum How did a Chinese woman live 24 years missing part of her brain?
  Sports
Sports Nut
Sept. 15 2014 9:05 PM Giving Up on Goodell How the NFL lost the trust of its most loyal reporters.