Jun 17
As any experienced computer programmer knows, there are unwritten laws that govern software development. However there are no penalties for breaking these laws; rather, there is often a reward. Following are 21 Laws of Computer Programming:
- Any given program, once deployed, is already obsolete.
- It is easier to change the specification to fit the program than vice versa.
- If a program is useful, it will have to be changed.
- If a program is useless, it will have to be documented.
- Only ten percent of the code in any given program will ever execute.
- Software expands to consume all available resources.
- Any non-trivial program contains at least one error.
- The probability of a flawless demo is inversely proportional to the number of people watching, raised to the power of the amount of money involved.
- Not until a program has been in production for at least six months will its most harmful error be discovered.
- Undetectable errors are infinite in variety, in contrast to detectable errors, which by definition are limited.
- The effort required to correct an error increases exponentially with time.
- Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.
- Any code of your own that you haven’t looked at in months might as well have been written by someone else.
- Inside every small program is a large program struggling to get out.
- The sooner you start coding a program, the longer it will take.
- A carelessly planned project takes three times longer to complete than expected; a carefully planned project takes only twice as long.
- Adding programmers to a late project makes it later.
- A program is never less than 90% complete, and never more than 95% complete.
- If you automate a mess, you get an automated mess.
- Build a program that even a fool can use, and only a fool will want to use it.
- Users truly don’t know what they want in a program until they use it.
Popularity: 62% [?]
Related posts:
- Unwritten Laws of Technology
- Computer Programming is Fun
- Christmas Computer Programming
- Best Programming Jokes
- 101 Great Computer Programming Quotes




June 17th, 2008 at 2:50 pm
#16 is ambiguous: is it twice as long as expected, or twice as long as the carelessly planned project?
June 17th, 2008 at 3:03 pm
[...] 21 Laws of Computer Programming – DevTopics Humoristic list with an undertone of reality [...]
June 17th, 2008 at 6:03 pm
Hi Jo, LOL, spoken like a true programmer! Must have unambiguous specifications!
The ambiguity is resolved with the word “only,” which implies that the “twice as long” refers to “than expected,” not 2 x 3 = 6. ;-)
June 19th, 2008 at 1:45 am
Too true! Thanks for the list.
June 19th, 2008 at 8:52 am
these aren’t laws, they’re someone’s opinions of laws.
sorry, i know this is supposed to be funny, but this is the last blog article “top # of xyz” where I stay quiet
June 19th, 2008 at 9:05 am
Having a bad day, tim?
June 19th, 2008 at 9:36 am
all true…
June 22nd, 2008 at 6:52 pm
Murphy s law applied to programming!
June 23rd, 2008 at 3:22 am
[...] 21 laws of computer programming [...]
June 23rd, 2008 at 3:50 am
[...] Taken from: http://www.devtopics.com/21-laws-of-computer-programming/ [...]
June 23rd, 2008 at 11:55 pm
@tim
They’re not interpretations. Any programmer knows that these are all true, sadly.
June 24th, 2008 at 7:51 am
Jo,
[In response to #16 ambiguity]
the usage of the word ‘only’ suggests that the later is less than the former, so I’d say it’s “twice as long as expected”
June 25th, 2008 at 1:57 pm
“#17 Adding programmers to a late project makes it later.”
LOL
June 26th, 2008 at 9:26 am
It’s good to read these things coming from someone else. I ran into many of these problems and I just thought I sucked.
June 28th, 2008 at 3:35 pm
Humorous, witty, and true. You were creative and thorough to analyze and extract the concealed truth and especially were able define it intelligently. Thumbs up!!!
June 29th, 2008 at 10:41 am
nice useful list.
June 29th, 2008 at 5:18 pm
[...] el blog “DevTopics“, he encontrado estas 21 leyes de la programación, que ciertamente muchos desarrolladores de [...]
June 30th, 2008 at 10:30 am
20 made me laugh really and I also agree to 21 coz my clients always change their mind as soon as something is achieved as a deliverable
July 1st, 2008 at 8:18 am
really nice
July 2nd, 2008 at 10:34 pm
Haha, thanks, that made me laugh… and cry at the same time.
July 4th, 2008 at 4:23 am
Wow. Good to know since I plan to get into programming.
July 21st, 2008 at 9:38 pm
not bad. I like the part about the obsolete statement, very satirical.
Check this out for learning programming languages:
http://www.codesplunk.com
July 23rd, 2008 at 7:10 pm
My two favs are any code you haven’t looked at in a month might as well have been written by someone else. – I’m always going back and looking at things I coded 3 months ago or more and it takes me a while just to figure out how I did what I did and then another while to figure out why.
The second fav is if you automate a mess all you get is an automated mess. – So so true. If a process isn’t working making it go faster doesn’t solve the problem.
July 24th, 2008 at 11:38 am
#6 is actually an extension of Parkinson’s Law. http://en.wikipedia.org/wiki/Parkinson’s_law
#17 is covered in the Mythical Man Month. The author is serious.
#13: I’ve learned to comment my code extensively. I pretend that in six months somebody will have to work on the code again, and that it might be me. If it isn’t me, I’ll have to stop whatever I AM working on to answer questions.
It’s true often enough to continue to motivate me.
I’ve gotten high praise for the quality of my commenting.
#15 is just a corollary of #6.
#19 is covered in Code Complete 2, in a fashion. He urges you to get your code working RIGHT before worrying about getting it working FAST. If you optimize bad code you’ll end up with fast, bad code, and you’ll just end up throwing away all the effort along with the optimized code.
Sorry if I seem to be picking on this list, I’m really not. It’s a pretty good list and funny. It’s just that after 3 decades of programming I’ve learned most of these laws the hard way. :)
August 7th, 2008 at 2:35 am
[...] 21 Laws of Computer Programming – Unwritten ‘Laws’ of programming. [...]
August 13th, 2008 at 1:37 pm
[...] visit this link to see the rest. [...]
October 28th, 2008 at 1:18 am
89 Ways for You to Become the Coolest Programmer in the World…
Since there are dozens of posts on becoming a better developer, but no single post with all the advice you need, perhaps, you’ll find this short guide useful.
1. Learn the Skills You Need
Learn the programming basics
“The goal of this guide is to b…
February 2nd, 2009 at 2:49 pm
[...] begin with: The 21 Laws of Computer Programming. These laws aren’t hilarious, they will raise a smile or a small chuckle but after that they [...]
March 5th, 2009 at 9:10 am
What are the laws which apply to people who use computers at home?
March 14th, 2009 at 3:56 am
You are a Project Manager in a software company that develops customized software products. You are required to deliver an accounting software for a well known organization of the country. One of the subordinates of your team has recently resigned from the job and had joined one of your competitors. You have heard from others that the person who resigned from your team is developing a generic software product which has the same features of the accounting software product that your company is presently developing. It seems that the person who resigned had stolen the source code from your company and is using it in his new workplace.
You are required to act on the suggestions listed below. Marks will be allocated as indicated.
Write down the problems that might occur in the above scenario
May 4th, 2009 at 1:33 pm
ha! good list!
June 9th, 2009 at 3:28 am
Amusing list, but I’m disturbed by the lack of attribution. I’ve seen most of these before, #17 is Brook’s Law, etc. #11 is a bombastic restatement of a commonplace principle – the later you fix a bug the more it costs – but I doubt the “exponentially” could be justified.
August 14th, 2009 at 9:23 am
[...] Laws of Technology Humor, PC Add comments We’ve discussed before the “21 Laws of Computer Programming.” Now PC World has come up with “35 Unwritten Laws of Technology.” Here are some [...]
August 25th, 2009 at 5:42 pm
[...] 21 Laws of Computer Programming http://www.devtopics.com/21-laws-of-computer-programming – view page – cached #DevTopics RSS Feed DevTopics » 21 Laws of Computer Programming Comments Feed DevTopics Hello, World Install WordPress on GoDaddy Shared Hosting One Billion PCs — From the page [...]
November 11th, 2009 at 10:37 am
I agree with most, except for #5: “Only ten percent of the code in any given program will ever execute.”
If this is so, and it can be measured easily, than not only the code has flaws, but the coder as well. I agree that _some_ code may never run, but is there for “completeness”, but if 90% of your code is not used than you have serious project planning and implementation issues at hand ;)
December 4th, 2009 at 8:24 pm
LOL, I love this list, I especially believe #21. Great list.
December 8th, 2009 at 12:52 pm
LOL How true
December 15th, 2009 at 5:09 pm
#8 Is simply beautiful. I’ll never know how a customer manages to do that with only presence !
January 14th, 2010 at 1:47 pm
I’d love to see a project manager’s face while reading these laws!!!
January 15th, 2010 at 8:52 pm
What are the laws which apply to people who use computers at home?