110
votes

What's your favourite quote about programming?

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

0

166 Answers 166

1
2 3 4 5 6
231
votes
+100

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

5
  • 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. Oct 12, 2010 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. Oct 25, 2010 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. Nov 12, 2010 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. Nov 12, 2010 at 17:48
  • 2
    But what if it's "perfect" code? There's no way to "debug" that. Dec 12, 2010 at 4:34
183
votes

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

— Edward V Berard

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

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

7
  • 72
    Brain stack overflow. Sep 2, 2010 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, 2010 at 4:08
  • 4
    It may converge for sufficient small values of "longer"
    – mouviciel
    Sep 22, 2010 at 18:02
  • 3
    +1 - I'm proud to count myself among the top billion programmers along with Douglas Hofstadter. Oct 11, 2010 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, 2010 at 17:43
126
votes

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

— Rick Osborne

4
  • 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, 2010 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, 2010 at 21:09
  • 8
    @webbiedave You work on ReiserFS? :) Nov 1, 2010 at 15:08
  • The company must really hate you if the killer got your job. Dec 12, 2010 at 4:36
118
votes

You can have the project:

  • Done On Time
  • Done On Budget
  • Done Properly

Pick two.

— Unknown

8
  • 22
    en.wikipedia.org/wiki/Project_triangle
    – rwong
    Sep 9, 2010 at 12:16
  • 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, 2010 at 4:59
  • Don't forget that exceptions do exist, though they're rare - don't count on it. Dec 16, 2010 at 18:39
  • 5
    @Maxpm: The version I heard was "The 4 S's: Smart, Sexy, Sane, Single. Pick 3." Jan 20, 2011 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, 2011 at 20:22
111
votes

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

— Jamie Zawinski

8
  • 5
    A timeless classic Sep 8, 2010 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. Sep 22, 2010 at 18:58
  • 40
    Some people when confronted with a problem don't think, they just post on StackOverflow
    – Matt Ellen
    Oct 11, 2010 at 8:16
  • 5
    Some people don't understand regular expressions, and hate them because others do.
    – Orbling
    Dec 16, 2010 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, 2010 at 3:59
110
votes

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

— Jan L. A. van de Snepscheut

3
  • 27
    I've also heard "The difference between theory and practice is smaller in theory than in practice."
    – Roger Pate
    Sep 10, 2010 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, 2010 at 18:45
  • 2
    I'd say if a theory doesn't translate to practice, then the theory is simply incomplete. Dec 28, 2010 at 1:35
105
votes

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.

21
  • 14
    Highly applicable IMO Sep 9, 2010 at 1:06
  • 3
    Luckily for us when most software goes wrong it doesn't collapse and kill people. Sep 29, 2010 at 10:58
  • 8
    Except when it blows up an Ariane 5 (Flight 501), or doses people with lethally high levels of radiation... Oct 2, 2010 at 19:58
  • 2
    Ironically, I believe many of Frank Lloyd Wright's more convoluted buildings have fallen into disrepair.
    – Maxpm
    Dec 16, 2010 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. Dec 26, 2010 at 0:49
103
votes

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

98
votes

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

4
  • 2
    -- Bill Gates (softwarequotes.com/printableshowquotes.aspx?id=579) Sep 9, 2010 at 18:04
  • 3
    This is true on multiple levels. A gem.
    – user1249
    Oct 10, 2010 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, 2010 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, 2011 at 0:10
86
votes

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.)

4
  • I've never seen a quote point out how difficult naming things can be. I feel a sudden solidarity. Oct 12, 2010 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, 2011 at 18:19
  • @StuperUser whooosh! you missed the joke!
    – Agos
    Jan 20, 2011 at 17:27
  • Took two seconds to get that after you pointed that out. Herp derp.
    – StuperUser
    Jan 20, 2011 at 18:10
85
votes

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

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

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. (…)

6
  • 2
    @Roger Pate: I suspect you're right, most people don't realize there is more to the quote. Sep 9, 2010 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, 2010 at 17:36
  • @Roger Pate:Not at all! Sep 11, 2010 at 3:29
  • 5
    +1 Thanks for the full quote. I never know there was more to it. Sep 11, 2010 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, 2010 at 1:15
80
votes

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

— Unknown

2
  • 35
    Or in many cases, make them stop appearing entirely. Sep 27, 2010 at 14:44
  • 12
    @Graeme those cases are called Heisenbugs :) Sep 27, 2010 at 19:40
76
votes

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

8
  • Who said that originally? Sep 6, 2010 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. Sep 9, 2010 at 1:14
  • 2
    Tom Cargill of Bell Labs: en.wikipedia.org/wiki/Ninety-ninety_rule Sep 9, 2010 at 2:46
  • 1
    I know this: 20% mates drink 80% beer.
    – Zzz
    Oct 1, 2010 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, 2010 at 8:58
70
votes

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

4
  • 22
    funny, just made me think of php.
    – WalterJ89
    Oct 7, 2010 at 16:40
  • 2
    @WalterJ89: Worry not! Up until PHP 5.3, PHP is refcounted.
    – zneak
    Oct 10, 2010 at 23:17
  • I like this one!
    – MDV2000
    Oct 13, 2010 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, 2011 at 21:13
68
votes

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

— Edsger Dijkstra

3
  • 4
    Yes, but this is supposed to be about programming, not computer science. [sly grin]
    – Mark C
    Oct 11, 2010 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, 2010 at 1:18
  • I've always felt that the most annoying thing about programming is that I can't separate it from computers. Mar 29, 2011 at 15:51
56
votes

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

— Bjarne Stroustrup

3
  • 15
    bad excuse for C++ suckage
    – hasen
    Nov 12, 2010 at 10:17
  • 3
    C# is an obvious counter-example.
    – Timwi
    Dec 26, 2010 at 12:46
  • 7
    And VB falls into both categories. Jan 20, 2011 at 12:09
56
votes

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

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

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

1
  • The worst thing being that you can't be more wrong ? Apr 24, 2011 at 23:31
46
votes

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.

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

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

0
42
votes

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

39
votes

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
  • 3
    Now you just have to argue about which unicode Dec 26, 2010 at 2:18
  • @Martin: Not really, because conversion between the various kinds is lossless. Jan 27, 2011 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?" Feb 8, 2011 at 9:34
39
votes

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

5
  • 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, 2010 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.
    – Benbob
    Dec 10, 2010 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, 2010 at 5:10
  • 2
    I enjoy writing comments too, but you wouldn’t want to see my bathroom.
    – Timwi
    Dec 26, 2010 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. Jun 19, 2011 at 22:08
38
votes

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

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

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

0
34
votes

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.)

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

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

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

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.

3
  • sounds a bit like the monkey / typewriter rule to me... Nov 12, 2010 at 10:07
  • Why do Linux enthusiasts seem to spend more time repeating this quote than fixing the bugs?
    – Timwi
    Dec 26, 2010 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/… Jan 12, 2011 at 0:37
1
2 3 4 5 6

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