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

Politics

The Democrats’ War at Home

How can the president’s party defend itself from the president’s foreign policy blunders?

The Religious Right Is Not Happy With Republicans  

The XX Factor
Oct. 1 2014 4:58 PM The Religious Right Is Not Happy With Republicans  

How Did the Royals Win Despite Bunting So Many Times? Bunting Is a Terrible Strategy.

Catacombs Where You Can Stroll Down Hallways Lined With Corpses

Homeland Is Good Again! For Now.

Crime

Operation Backbone

How White Boy Rick, a legendary Detroit cocaine dealer, helped the FBI uncover brazen police corruption.

Music

How Even an Old Hipster Can Age Gracefully

On their new albums, Leonard Cohen, Robert Plant, and Loudon Wainwright III show three ways.

The One Fact About Ebola That Should Calm You: It Spreads Slowly

Piper Kerman on Why She Dressed Like a Hitchcock Heroine for Her Prison Sentencing

Trending News Channel
Oct. 1 2014 1:25 PM Japanese Cheerleader Robots Balance and Roll Around on Balls
  News & Politics
Crime
Oct. 1 2014 4:15 PM The Trials of White Boy Rick A Detroit crime legend, the FBI, and the ugliness of the war on drugs.
  Business
Moneybox
Oct. 1 2014 2:16 PM Wall Street Tackles Chat Services, Shies Away From Diversity Issues 
  Life
Outward
Oct. 1 2014 6:02 PM Facebook Relaxes Its “Real Name” Policy; Drag Queens Celebrate
  Double X
The XX Factor
Oct. 1 2014 5:11 PM Celebrity Feminist Identification Has Reached Peak Meaninglessness
  Slate Plus
Behind the Scenes
Oct. 1 2014 3:24 PM Revelry (and Business) at Mohonk Photos and highlights from Slate’s annual retreat.
  Arts
Brow Beat
Oct. 1 2014 3:02 PM The Best Show of the Summer Is Getting a Second Season
  Technology
Future Tense
Oct. 1 2014 4:46 PM Ebola Is No Measles. That’s a Good Thing. Comparing this virus to scourges of the past gives us hope that we can slow it down.
  Health & Science
Science
Oct. 1 2014 4:03 PM Does the Earth Really Have a “Hum”? Yes, but probably not the one you’re thinking.
  Sports
Sports Nut
Oct. 1 2014 5:19 PM Bunt-a-Palooza! How bad was the Kansas City Royals’ bunt-all-the-time strategy in the American League wild-card game?