What's your favourite quote about programming?

One quote per answer, and please check for duplicates before posting!

closed as not constructive by Walter, ChrisF Feb 7 '11 at 13:10

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

locked by yannis Sep 14 '12 at 17:07

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

166 Answers 166

up vote 232 down vote

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

— Brian W. Kernighan

  • Everytime I'm writing some clever bit of code, I remind myself of this rule and look back over it to see if I can't do things in a simpler way that will be easier to maintain later, or at least add some more comments. – CodexArcanum Oct 12 '10 at 19:26
  • 6
    A corolloary of an otherwise true maxim: Don't forget that a diagram can increase your brain power. You can swap out "remember structure of big thing" to nonvolatile paper. – Tim Williscroft Oct 25 '10 at 0:49
  • 1
    I love the quote but the implication is that we should at most put 50% of our effort into coding in the first place. – Jon Hopkins Nov 12 '10 at 9:55
  • 4
    I think the implication is that you should avoid that programmer's urge to use the 'clever' way to do something when the slightly longer, more obvious way of doing something works just fine. – Fishtoaster Nov 12 '10 at 17:48
  • 2
    But what if it's "perfect" code? There's no way to "debug" that. – Mateen Ulhaq Dec 12 '10 at 4:34

Walking on water and developing software from a specification are easy if both are frozen.

— Edward V Berard

  • Quote of the year, I'm gonna use this one – Gortron Dec 16 '10 at 20:24
  • I hate this one. It's never the case, so who cares? – JP Alioto Dec 26 '10 at 6:52

It always takes longer than you expect, even when you take into account Hofstadter's Law.
  — Hofstadter's Law

  • 72
    Brain stack overflow. – Nathan Taylor Sep 2 '10 at 1:45
  • 3
    @Joe D: I'm curious how you'd rewrite a recursive English sentence into a single non-recursive sentence. – Jon Purdy Sep 22 '10 at 4:08
  • 4
    It may converge for sufficient small values of "longer" – mouviciel Sep 22 '10 at 18:02
  • 3
    +1 - I'm proud to count myself among the top billion programmers along with Douglas Hofstadter. – Peter Turner Oct 11 '10 at 16:09
  • @g.f: When it's transformed into defining the source afterwards (with a dash), the leading introduction isn't warranted ("A: Blah." -> "Blah. -- A"). This isn't removing part of the quote. – Roger Pate Oct 11 '10 at 17:43

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

— Rick Osborne

  • 12
    it seems I keep ending up maintaining code that I wish I knew where the creator lived, but its probably a good thing I don't. – WalterJ89 Sep 10 '10 at 7:00
  • Brings new meaning to the term "killer app." I seem to always end up maintaining the psychopath's code after he's incarcerated. – webbiedave Oct 12 '10 at 21:09
  • 8
    @webbiedave You work on ReiserFS? :) – Neil Aitken Nov 1 '10 at 15:08
  • The company must really hate you if the killer got your job. – Mateen Ulhaq Dec 12 '10 at 4:36

You can have the project:

  • Done On Time
  • Done On Budget
  • Done Properly

Pick two.

— Unknown

  • 22
  • 5
    Reminds me of a similar triangle, but with women. "You can have a girlfriend that: Is smart, is attractive, has a good personality." – Maxpm Dec 16 '10 at 4:59
  • Don't forget that exceptions do exist, though they're rare - don't count on it. – Mircea Chirea Dec 16 '10 at 18:39
  • 5
    @Maxpm: The version I heard was "The 4 S's: Smart, Sexy, Sane, Single. Pick 3." – Mason Wheeler Jan 20 '11 at 18:27
  • 1
    So, when there are no constraints on time and budget you cannot do it properly. Good to know. – Antsan Jan 20 '11 at 20:22

Some people, when confronted with a problem, think "I know, I'll use regular expressions."
Now they have two problems.

— Jamie Zawinski

  • 5
    A timeless classic – Factor Mystic Sep 8 '10 at 23:52
  • 5
    Some people, when confronted with a problem, think "I know, I'll use <some problem solving implementation>." Now they have two problems. – Callum Rogers Sep 22 '10 at 18:58
  • 40
    Some people when confronted with a problem don't think, they just post on StackOverflow – Matt Ellen Oct 11 '10 at 8:16
  • 5
    Some people don't understand regular expressions, and hate them because others do. – Orbling Dec 16 '10 at 17:14
  • 3
    @Yar - I've never found the syntax obtuse personally, and the density is a good thing. Why express something like a pattern match in a more verbose format? Where clarity is required for something complicated, the extended mode can be used with comments. – Orbling Dec 26 '10 at 3:59

In theory, there is no difference between theory and practice. But, in practice, there is.

— Jan L. A. van de Snepscheut

  • 27
    I've also heard "The difference between theory and practice is smaller in theory than in practice." – Roger Pate Sep 10 '10 at 17:02
  • 1
    Roger Pate's formulation is the one I heard, written by Olin Shivers in "History of T". Paul Graham talks about it here: paulgraham.com/thist.html – Michael H. Oct 11 '10 at 18:45
  • 2
    I'd say if a theory doesn't translate to practice, then the theory is simply incomplete. – Rei Miyasaka Dec 28 '10 at 1:35

You can use an eraser on the drafting table or a sledgehammer on the construction site - Frank Lloyd Wright

Not exactly a programming quote but it most certainly applies.

  • 14
    Highly applicable IMO – John MacIntyre Sep 9 '10 at 1:06
  • 3
    Luckily for us when most software goes wrong it doesn't collapse and kill people. – Neil Aitken Sep 29 '10 at 10:58
  • 8
    Except when it blows up an Ariane 5 (Flight 501), or doses people with lethally high levels of radiation... – Frank Shearar Oct 2 '10 at 19:58
  • 2
    Ironically, I believe many of Frank Lloyd Wright's more convoluted buildings have fallen into disrepair. – Maxpm Dec 16 '10 at 5:03
  • 1
    @TomWij, @Walter, @Roger: Please refrain from dirtying this site with your metatalk. If I wanted to hear bickering, I would visit meta.stackoverflow.com. This is where you should be having this fascinating and timeless conversation. – Dan Rosenstark Dec 26 '10 at 0:49

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

— Rick Cook

Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
  — Bill Gates

  • 2
    -- Bill Gates (softwarequotes.com/printableshowquotes.aspx?id=579) – Bill Karwin Sep 9 '10 at 18:04
  • 3
    This is true on multiple levels. A gem. – user1249 Oct 10 '10 at 19:21
  • 3
    The key difference being, of course, that the aircraft's final weight is known while the software's final LOC count is unknown. – mmyers Oct 28 '10 at 15:40
  • 5
    So why do most Microsoft products give me this feeling that I'm chained by my foot to an airplane that is struggling to get off the runway? – Sharpie Jan 9 '11 at 0:10

There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.

    — Leon Bambrick (@secretGeek)

(Actually, everything from http://q4td.blogspot.com/search/label/programming seeing as I curate the list.)

  • I've never seen a quote point out how difficult naming things can be. I feel a sudden solidarity. – CodexArcanum Oct 12 '10 at 19:30
  • That's 3 things. The first two are the original quote from Phil Karlton. @CodexArcanum. Naming things well is the trick. – StuperUser Jan 18 '11 at 18:19
  • @StuperUser whooosh! you missed the joke! – Agos Jan 20 '11 at 17:27
  • Took two seconds to get that after you pointed that out. Herp derp. – StuperUser Jan 20 '11 at 18:10

Nine people can't make a baby in a month.
  — Fred Brooks, The Mythical Man-Month

  • 14
    technically: 18 people can't make a baby in a month – Here Be Wolves Sep 27 '10 at 19:45
  • 13
    @HereBeWolves or 10 – WalterJ89 Oct 7 '10 at 16:39
  • 14
    What's wrong with 1 guy and 8 ladies? Sounds just about right to me. – Roger Pate Oct 10 '10 at 3:40
  • 4
    If we go for twins or triplets we need fewer ladies. – user1249 Oct 21 '10 at 6:37
  • 12
    While the first baby will suffer 9 months latency, proper pipelining will continue to deliver 1 per month... – Brian Knoblauch Jan 19 '11 at 15:42

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.
  — Donald Knuth, Structured Programming with go to Statements, JACM Computing Surveys, Vol 6, No. 4, Dec. 1974, p.268

This is extracted from the below two paragraphs, which not only say why he comes to the above conclusion, but gives information on how to avoid this mistake:

There is no doubt that the grail of efficiency leads to abuse. Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.

Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified. It is often a mistake to make a priori judgments about what parts of a program are really critical, since the universal experience of programmers who have been using measurement tools has been that their intuitive guesses fail. (…)

  • 2
    @Roger Pate: I suspect you're right, most people don't realize there is more to the quote. – Scott Dorman Sep 9 '10 at 14:01
  • 5
    Hope you don't mind that I included a bit more. I think it's really important and maybe this will encourage more to read the full paper. :) – Roger Pate Sep 10 '10 at 17:36
  • @Roger Pate:Not at all! – Scott Dorman Sep 11 '10 at 3:29
  • 5
    +1 Thanks for the full quote. I never know there was more to it. – Evan Plaice Sep 11 '10 at 9:10
  • 2
    It's great that you posted the entire quote. A lot of people just know the sort version and have no idea what Knuth actually meant by that. – DasIch Dec 26 '10 at 1:15

Debuggers don't remove bugs. They only show them in slow motion.

— Unknown

  • 35
    Or in many cases, make them stop appearing entirely. – Graeme Perrow Sep 27 '10 at 14:44
  • 12
    @Graeme those cases are called Heisenbugs :) – Here Be Wolves Sep 27 '10 at 19:40

The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.

Tom Cargill

  • Who said that originally? – Paddyslacker Sep 6 '10 at 6:45
  • 10
    I think you'll find that 90% of the code takes 90% of the time, and the last 10% of the code takes the other 90% of the time. – FacticiusVir Sep 9 '10 at 1:14
  • 2
    Tom Cargill of Bell Labs: en.wikipedia.org/wiki/Ninety-ninety_rule – Bill Karwin Sep 9 '10 at 2:46
  • 1
    I know this: 20% mates drink 80% beer. – Zzz Oct 1 '10 at 21:41
  • 1
    Personally, I'd say that the first 90% of the code accounts for the first 90% of the development time. Then, the remaining 90% of the code accounts for the other 90% of the development time. – Kaz Dragon Oct 21 '10 at 8:58

If Java had true garbage collection, most programs would delete themselves upon execution.
  — Robert Sewell

  • 22
    funny, just made me think of php. – WalterJ89 Oct 7 '10 at 16:40
  • 2
    @WalterJ89: Worry not! Up until PHP 5.3, PHP is refcounted. – zneak Oct 10 '10 at 23:17
  • I like this one! – MDV2000 Oct 13 '10 at 18:43
  • @WalterJ89 Well, I see no reason to single out Java as opposed to COBOL, C++, VB, or others. – Mark C Mar 2 '11 at 21:13

Computer Science is no more about computers than astronomy is about telescopes

— Edsger Dijkstra

  • 4
    Yes, but this is supposed to be about programming, not computer science. [sly grin] – Mark C Oct 11 '10 at 17:21
  • Programming is just applying the knowledge gathered with computer science. You don't need a computer to program, at least not one like most are familiar with. – DasIch Dec 26 '10 at 1:18
  • I've always felt that the most annoying thing about programming is that I can't separate it from computers. – LoveMeSomeCode Mar 29 '11 at 15:51

If debugging is the process of removing software bugs, then programming must be the process of putting them in.
  — Edsger Dijkstra

  • 24
    That's why I like to refer to my job as enbugging. – deceze Sep 13 '10 at 2:02
  • 9
    And maintenance as rebugging? – Joe D Oct 8 '10 at 22:41
  • 1
    @JoeD No, "bugwatching". – Mark C Oct 11 '10 at 17:22

There are only two kinds of languages: the ones people complain about and the ones nobody uses

— Bjarne Stroustrup

  • 15
    bad excuse for C++ suckage – hasen Nov 12 '10 at 10:17
  • 3
    C# is an obvious counter-example. – Timwi Dec 26 '10 at 12:46
  • 7
    And VB falls into both categories. – Quick Joe Smith Jan 20 '11 at 12:09

The best thing about a boolean is even if you are wrong, you are only off by a bit. - (Anonymous)

  • The worst thing being that you can't be more wrong ? – POSIX_ME_HARDER Apr 24 '11 at 23:31

On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" In one case a member of the Upper, and in the other a member of the Lower House put this question. I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
  — Charles Babbage

Arguably the first documented case of a programmer encountering stupid user questions.

  • 5
    Sounds like a T-Shirt idea! "User Error: Fouling things up since 1832". (Date?) – Mark C Sep 28 '10 at 12:48

I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone

-- Bjarne Stroustrup

It's all talk until the code runs.
  — Ward Cunningham

Unicode support is not a “feature”. It is expected behaviour.

Granted, it is very specific, but it is my favourite because obsolete character sets are just too widely used still...

  • 3
    Now you just have to argue about which unicode – Martin Beckett Dec 26 '10 at 2:18
  • @Martin: Not really, because conversion between the various kinds is lossless. – Billy ONeal Jan 27 '11 at 23:38
  • Aargh the pain! Why do I have to argue with a client that no, we can't "just" switch our whole infrastructure to Latin-1 to make it infinitesimally more convenient for him? "After all, nobody around here uses those weird special characters; can't be so hard, right?" – Piskvor Feb 8 '11 at 9:34

Commenting your code is like cleaning your bathroom - you never want to do it, but it really does create a more pleasant experience for you and your guests.

— Ryan Campbell

  • 1
    Meh...Most comments I've encountered in my life are written under the assumption that comments can make up for poorly written code.. – riwalk Oct 14 '10 at 20:53
  • You can clean the bathroom, but if the shower only has cold water and the sink has no soap it's going to be an unpleasant experience. Write code that reads easily rather than writing huge comments to explain things. – Keyo Dec 10 '10 at 2:19
  • I actually find commenting quite enjoyable. Sometimes I put important comments in neat little boxes made of asterisks and slashes. Then again, I'm a freak. – Maxpm Dec 16 '10 at 5:10
  • 2
    I enjoy writing comments too, but you wouldn’t want to see my bathroom. – Timwi Dec 26 '10 at 12:48
  • I was at a washroom once where there were really long-winded comments all over about how and why you should keep the washroom clean. It wasn't clean. – Rei Miyasaka Jun 19 '11 at 22:08

The fool wonders, the wise man asks.
  — Benjamin Disraeli

  • Made one per-answer. – Roger Pate Oct 8 '10 at 11:27
  • @TomWij: See my comment from when I edited this, these quotes have been split into separate answers. – Roger Pate Oct 11 '10 at 16:11

Programming is like sex: one mistake and you have to support it for the rest of your life.
  — Michael Sinz

Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.
  — Antoine de Saint-Exupéry, French writer (1900-1944), Terre des Hommes (1939)

(It would seem that perfection is attained not when there is nothing left to add, but when there is nothing left to take away.)

  • And it is also valid for music – Heinz Z. Oct 11 '10 at 13:35
  • 2
    Perfection Is – David Kendal Jan 19 '11 at 1:43
  • 2
    @David Kendal: Nice! Similarly, Henry David Thoreau said, "Simplify, Simplify." Which always makes me think, "Simplify." – Bill Karwin Jan 27 '11 at 21:37

Java is to JavaScript as car is to carpet.
  — Chris Heilmann

  • There is carpet in my car, so there is Javascript in Java? – Keyo Dec 10 '10 at 2:26
  • 1
    @Keyo: Yeah, I thought of that take on it. I still think the quote is really clever. – Bill Karwin Dec 10 '10 at 4:00

As formulated by Eric S. Raymond:

Linus's Law

Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix obvious to someone.

Or, less formally,

Given enough eyeballs, all bugs are shallow.

  • sounds a bit like the monkey / typewriter rule to me... – Sean Patrick Floyd Nov 12 '10 at 10:07
  • Why do Linux enthusiasts seem to spend more time repeating this quote than fixing the bugs? – Timwi Dec 26 '10 at 12:55
  • Or, Atwood's slogan for StackOverflow, "None of us is as dumb as all of us". See codinghorror.com/blog/2008/09/… – Evan Plaice Jan 12 '11 at 0:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.