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:

TODAY IN SLATE

Justice Ginsburg’s Crucial Dissent in the Texas Voter ID Case

The Jarring Experience of Watching White Americans Speak Frankly About Race

Here’s Just How Far a Southern Woman May Have to Drive to Get an Abortion

The Most Ingenious Teaching Device Ever Invented

Marvel’s Civil War Is a Far-Right Paranoid Fantasy

It’s also a mess. Can the movies do better?

Behold

Sprawl, Decadence, and Environmental Ruin in Nevada

Space: The Next Generation

An All-Female Mission to Mars

As a NASA guinea pig, I verified that women would be cheaper to launch than men.

Watching Netflix in Bed. Hanging Bananas. Is There Anything These Hooks Can’t Solve?

The 2014 Kansas City Royals Show the Value of Building a Mediocre Baseball Team

  News & Politics
The World
Oct. 20 2014 1:50 PM Why We Shouldn’t be Too Sure About the Supposed Deal to Return the Abducted Nigerian Schoolgirls
  Business
Moneybox
Oct. 20 2014 2:16 PM Even When They Go to College, The Poor Sometimes Stay Poor
  Life
Outward
Oct. 20 2014 2:19 PM A Procedural Rule Could Keep Gay Marriage From Ever Reaching SCOTUS Again
  Double X
The XX Factor
Oct. 20 2014 1:10 PM Women Are Still Losing Jobs for Getting Pregnant
  Slate Plus
Tv Club
Oct. 20 2014 7:15 AM The Slate Doctor Who Podcast: Episode 9 A spoiler-filled discussion of "Flatline."
  Arts
Brow Beat
Oct. 20 2014 1:26 PM This $248 Denim Jumpsuit Is the Latest Example of a Horrible Fashion Tradition
  Technology
Future Tense
Oct. 20 2014 1:51 PM Will Amazon Lead Us to the Golden Age of Books? A Future Tense Event.
  Health & Science
Medical Examiner
Oct. 20 2014 11:46 AM Is Anybody Watching My Do-Gooding? The difference between being a hero and being an altruist.
  Sports
Sports Nut
Oct. 20 2014 10:23 AM Where I Was Wrong About the Royals I underestimated the value of building a team that’s just barely better than mediocre.