What's your favourite quote about programming?
One quote per answer, and please check for duplicates before posting!
166 Answers 166
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– CodexArcanum2010年10月12日 19:26:40 +00:00Commented Oct 12, 2010 at 19:26
-
6A 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– Tim Williscroft2010年10月25日 00:49:21 +00:00Commented Oct 25, 2010 at 0:49
-
1I 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– Jon Hopkins2010年11月12日 09:55:43 +00:00Commented Nov 12, 2010 at 9:55
-
4I 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– Fishtoaster2010年11月12日 17:48:00 +00:00Commented Nov 12, 2010 at 17:48
-
2But what if it's "perfect" code? There's no way to "debug" that.Mateen Ulhaq– Mateen Ulhaq2010年12月12日 04:34:30 +00:00Commented Dec 12, 2010 at 4:34
Walking on water and developing software from a specification are easy if both are frozen.
— Edward V Berard
It always takes longer than you expect, even when you take into account Hofstadter's Law.
— Hofstadter's Law
-
72Brain stack overflow.Nathan Taylor– Nathan Taylor2010年09月02日 01:45:29 +00:00Commented 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– Jon Purdy2010年09月22日 04:08:39 +00:00Commented Sep 22, 2010 at 4:08
-
4It may converge for sufficient small values of "longer"mouviciel– mouviciel2010年09月22日 18:02:22 +00:00Commented Sep 22, 2010 at 18:02
-
3+1 - I'm proud to count myself among the top billion programmers along with Douglas Hofstadter.Peter Turner– Peter Turner2010年10月11日 16:09:36 +00:00Commented 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– Roger Pate2010年10月11日 17:43:30 +00:00Commented Oct 11, 2010 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
-
12it 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– WalterJ892010年09月10日 07:00:42 +00:00Commented 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– webbiedave2010年10月12日 21:09:53 +00:00Commented Oct 12, 2010 at 21:09
-
8@webbiedave You work on ReiserFS? :)Neil Aitken– Neil Aitken2010年11月01日 15:08:51 +00:00Commented Nov 1, 2010 at 15:08
-
The company must really hate you if the killer got your job.Mateen Ulhaq– Mateen Ulhaq2010年12月12日 04:36:30 +00:00Commented Dec 12, 2010 at 4:36
You can have the project:
- Done On Time
- Done On Budget
- Done Properly
Pick two.
— Unknown
-
22en.wikipedia.org/wiki/Project_trianglerwong– rwong2010年09月09日 12:16:13 +00:00Commented Sep 9, 2010 at 12:16
-
5Reminds me of a similar triangle, but with women. "You can have a girlfriend that: Is smart, is attractive, has a good personality."Maxpm– Maxpm2010年12月16日 04:59:13 +00:00Commented Dec 16, 2010 at 4:59
-
Don't forget that exceptions do exist, though they're rare - don't count on it.Mircea Chirea– Mircea Chirea2010年12月16日 18:39:12 +00:00Commented Dec 16, 2010 at 18:39
-
5@Maxpm: The version I heard was "The 4 S's: Smart, Sexy, Sane, Single. Pick 3."Mason Wheeler– Mason Wheeler2011年01月20日 18:27:48 +00:00Commented Jan 20, 2011 at 18:27
-
1So, when there are no constraints on time and budget you cannot do it properly. Good to know.Antsan– Antsan2011年01月20日 20:22:05 +00:00Commented Jan 20, 2011 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
-
5A timeless classicFactor Mystic– Factor Mystic2010年09月08日 23:52:12 +00:00Commented Sep 8, 2010 at 23:52
-
5Some people, when confronted with a problem, think "I know, I'll use <some problem solving implementation>." Now they have two problems.Callum Rogers– Callum Rogers2010年09月22日 18:58:07 +00:00Commented Sep 22, 2010 at 18:58
-
40Some people when confronted with a problem don't think, they just post on StackOverflowMatt Ellen– Matt Ellen2010年10月11日 08:16:57 +00:00Commented Oct 11, 2010 at 8:16
-
5Some people don't understand regular expressions, and hate them because others do.Orbling– Orbling2010年12月16日 17:14:00 +00:00Commented 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– Orbling2010年12月26日 03:59:00 +00:00Commented Dec 26, 2010 at 3:59
In theory, there is no difference between theory and practice. But, in practice, there is.
— Jan L. A. van de Snepscheut
-
27I've also heard "The difference between theory and practice is smaller in theory than in practice."Roger Pate– Roger Pate2010年09月10日 17:02:24 +00:00Commented Sep 10, 2010 at 17:02
-
1Roger 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.htmlMichael H.– Michael H.2010年10月11日 18:45:00 +00:00Commented Oct 11, 2010 at 18:45
-
2I'd say if a theory doesn't translate to practice, then the theory is simply incomplete.Rei Miyasaka– Rei Miyasaka2010年12月28日 01:35:06 +00:00Commented Dec 28, 2010 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.
-
14Highly applicable IMOJohn MacIntyre– John MacIntyre2010年09月09日 01:06:46 +00:00Commented Sep 9, 2010 at 1:06
-
3Luckily for us when most software goes wrong it doesn't collapse and kill people.Neil Aitken– Neil Aitken2010年09月29日 10:58:57 +00:00Commented Sep 29, 2010 at 10:58
-
8Except when it blows up an Ariane 5 (Flight 501), or doses people with lethally high levels of radiation...Frank Shearar– Frank Shearar2010年10月02日 19:58:54 +00:00Commented Oct 2, 2010 at 19:58
-
2Ironically, I believe many of Frank Lloyd Wright's more convoluted buildings have fallen into disrepair.Maxpm– Maxpm2010年12月16日 05:03:31 +00:00Commented 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.Dan Rosenstark– Dan Rosenstark2010年12月26日 00:49:14 +00:00Commented Dec 26, 2010 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– Bill Karwin2010年09月09日 18:04:36 +00:00Commented Sep 9, 2010 at 18:04
-
3This is true on multiple levels. A gem.user1249– user12492010年10月10日 19:21:40 +00:00Commented Oct 10, 2010 at 19:21
-
3The key difference being, of course, that the aircraft's final weight is known while the software's final LOC count is unknown.mmyers– mmyers2010年10月28日 15:40:24 +00:00Commented Oct 28, 2010 at 15:40
-
5So 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– Sharpie2011年01月09日 00:10:39 +00:00Commented Jan 9, 2011 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– CodexArcanum2010年10月12日 19:30:24 +00:00Commented 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– StuperUser2011年01月18日 18:19:14 +00:00Commented Jan 18, 2011 at 18:19
-
@StuperUser whooosh! you missed the joke!Agos– Agos2011年01月20日 17:27:28 +00:00Commented Jan 20, 2011 at 17:27
-
Took two seconds to get that after you pointed that out. Herp derp.StuperUser– StuperUser2011年01月20日 18:10:53 +00:00Commented Jan 20, 2011 at 18:10
Nine people can't make a baby in a month.
— Fred Brooks, The Mythical Man-Month
-
14technically: 18 people can't make a baby in a monthHere Be Wolves– Here Be Wolves2010年09月27日 19:45:12 +00:00Commented Sep 27, 2010 at 19:45
-
13@HereBeWolves or 10WalterJ89– WalterJ892010年10月07日 16:39:32 +00:00Commented Oct 7, 2010 at 16:39
-
14What's wrong with 1 guy and 8 ladies? Sounds just about right to me.Roger Pate– Roger Pate2010年10月10日 03:40:49 +00:00Commented Oct 10, 2010 at 3:40
-
4If we go for twins or triplets we need fewer ladies.user1249– user12492010年10月21日 06:37:24 +00:00Commented Oct 21, 2010 at 6:37
-
12While the first baby will suffer 9 months latency, proper pipelining will continue to deliver 1 per month...Brian Knoblauch– Brian Knoblauch2011年01月19日 15:42:26 +00:00Commented Jan 19, 2011 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– Scott Dorman2010年09月09日 14:01:07 +00:00Commented Sep 9, 2010 at 14:01
-
5Hope 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– Roger Pate2010年09月10日 17:36:18 +00:00Commented Sep 10, 2010 at 17:36
-
@Roger Pate:Not at all!Scott Dorman– Scott Dorman2010年09月11日 03:29:53 +00:00Commented Sep 11, 2010 at 3:29
-
5+1 Thanks for the full quote. I never know there was more to it.Evan Plaice– Evan Plaice2010年09月11日 09:10:09 +00:00Commented Sep 11, 2010 at 9:10
-
2It'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– DasIch2010年12月26日 01:15:52 +00:00Commented Dec 26, 2010 at 1:15
Debuggers don't remove bugs. They only show them in slow motion.
— Unknown
-
35Or in many cases, make them stop appearing entirely.Graeme Perrow– Graeme Perrow2010年09月27日 14:44:01 +00:00Commented Sep 27, 2010 at 14:44
-
12@Graeme those cases are called Heisenbugs :)Here Be Wolves– Here Be Wolves2010年09月27日 19:40:27 +00:00Commented Sep 27, 2010 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.
-
Who said that originally?Paddyslacker– Paddyslacker2010年09月06日 06:45:30 +00:00Commented Sep 6, 2010 at 6:45
-
10I 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– FacticiusVir2010年09月09日 01:14:10 +00:00Commented Sep 9, 2010 at 1:14
-
2Tom Cargill of Bell Labs: en.wikipedia.org/wiki/Ninety-ninety_ruleBill Karwin– Bill Karwin2010年09月09日 02:46:28 +00:00Commented Sep 9, 2010 at 2:46
-
1I know this: 20% mates drink 80% beer.777– 7772010年10月01日 21:41:42 +00:00Commented Oct 1, 2010 at 21:41
-
1Personally, 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– Kaz Dragon2010年10月21日 08:58:36 +00:00Commented Oct 21, 2010 at 8:58
If Java had true garbage collection, most programs would delete themselves upon execution.
— Robert Sewell
-
22funny, just made me think of php.WalterJ89– WalterJ892010年10月07日 16:40:53 +00:00Commented Oct 7, 2010 at 16:40
-
2@WalterJ89: Worry not! Up until PHP 5.3, PHP is refcounted.zneak– zneak2010年10月10日 23:17:20 +00:00Commented Oct 10, 2010 at 23:17
-
-
@WalterJ89 Well, I see no reason to single out Java as opposed to COBOL, C++, VB, or others.Mark C– Mark C2011年03月02日 21:13:17 +00:00Commented Mar 2, 2011 at 21:13
Computer Science is no more about computers than astronomy is about telescopes
— Edsger Dijkstra
-
4Yes, but this is supposed to be about programming, not computer science. [sly grin]Mark C– Mark C2010年10月11日 17:21:05 +00:00Commented 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– DasIch2010年12月26日 01:18:26 +00:00Commented 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.LoveMeSomeCode– LoveMeSomeCode2011年03月29日 15:51:33 +00:00Commented Mar 29, 2011 at 15:51
There are only two kinds of languages: the ones people complain about and the ones nobody uses
— Bjarne Stroustrup
-
15bad excuse for C++ suckagehasen– hasen2010年11月12日 10:17:21 +00:00Commented Nov 12, 2010 at 10:17
-
3C# is an obvious counter-example.Timwi– Timwi2010年12月26日 12:46:47 +00:00Commented Dec 26, 2010 at 12:46
-
7And VB falls into both categories.Quick Joe Smith– Quick Joe Smith2011年01月20日 12:09:48 +00:00Commented Jan 20, 2011 at 12:09
If debugging is the process of removing software bugs, then programming must be the process of putting them in.
— Edsger Dijkstra
-
24That's why I like to refer to my job as enbugging.deceze– deceze2010年09月13日 02:02:00 +00:00Commented Sep 13, 2010 at 2:02
-
9And maintenance as rebugging?Joe D– Joe D2010年10月08日 22:41:01 +00:00Commented Oct 8, 2010 at 22:41
-
1@JoeD No, "bugwatching".Mark C– Mark C2010年10月11日 17:22:50 +00:00Commented Oct 11, 2010 at 17:22
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– POSIX_ME_HARDER2011年04月24日 23:31:27 +00:00Commented Apr 24, 2011 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.
-
5Sounds like a T-Shirt idea! "User Error: Fouling things up since 1832". (Date?)Mark C– Mark C2010年09月28日 12:48:28 +00:00Commented Sep 28, 2010 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...
-
3Now you just have to argue about which unicodeMartin Beckett– Martin Beckett2010年12月26日 02:18:06 +00:00Commented Dec 26, 2010 at 2:18
-
@Martin: Not really, because conversion between the various kinds is lossless.Billy ONeal– Billy ONeal2011年01月27日 23:38:20 +00:00Commented 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?"Piskvor left the building– Piskvor left the building2011年02月08日 09:34:10 +00:00Commented Feb 8, 2011 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
-
1Meh...Most comments I've encountered in my life are written under the assumption that comments can make up for poorly written code..riwalk– riwalk2010年10月14日 20:53:27 +00:00Commented 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– Benbob2010年12月10日 02:19:05 +00:00Commented 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– Maxpm2010年12月16日 05:10:25 +00:00Commented Dec 16, 2010 at 5:10
-
2I enjoy writing comments too, but you wouldn’t want to see my bathroom.Timwi– Timwi2010年12月26日 12:48:24 +00:00Commented 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.Rei Miyasaka– Rei Miyasaka2011年06月19日 22:08:33 +00:00Commented Jun 19, 2011 at 22:08
The fool wonders, the wise man asks.
— Benjamin Disraeli
-
Made one per-answer.Roger Pate– Roger Pate2010年10月08日 11:27:16 +00:00Commented 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– Roger Pate2010年10月11日 16:11:23 +00:00Commented Oct 11, 2010 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 musicHeinz Z.– Heinz Z.2010年10月11日 13:35:33 +00:00Commented Oct 11, 2010 at 13:35
-
2Perfection IsDavid Kendal– David Kendal2011年01月19日 01:43:05 +00:00Commented Jan 19, 2011 at 1:43
-
2@David Kendal: Nice! Similarly, Henry David Thoreau said, "Simplify, Simplify." Which always makes me think, "Simplify."Bill Karwin– Bill Karwin2011年01月27日 21:37:06 +00:00Commented Jan 27, 2011 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?Benbob– Benbob2010年12月10日 02:26:03 +00:00Commented Dec 10, 2010 at 2:26
-
1@Keyo: Yeah, I thought of that take on it. I still think the quote is really clever.Bill Karwin– Bill Karwin2010年12月10日 04:00:00 +00:00Commented Dec 10, 2010 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– Sean Patrick Floyd2010年11月12日 10:07:17 +00:00Commented Nov 12, 2010 at 10:07
-
Why do Linux enthusiasts seem to spend more time repeating this quote than fixing the bugs?Timwi– Timwi2010年12月26日 12:55:04 +00:00Commented 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/…Evan Plaice– Evan Plaice2011年01月12日 00:37:03 +00:00Commented Jan 12, 2011 at 0:37