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:




  1. Any given program, once deployed, is already obsolete.
  2. It is easier to change the specification to fit the program than vice versa.
  3. If a program is useful, it will have to be changed.
  4. If a program is useless, it will have to be documented.
  5. Only ten percent of the code in any given program will ever execute.
  6. Software expands to consume all available resources.
  7. Any non-trivial program contains at least one error.
  8. 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.
  9. Not until a program has been in production for at least six months will its most harmful error be discovered.
  10. Undetectable errors are infinite in variety, in contrast to detectable errors, which by definition are limited.
  11. The effort required to correct an error increases exponentially with time.
  12. Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.
  13. Any code of your own that you haven’t looked at in months might as well have been written by someone else.
  14. Inside every small program is a large program struggling to get out.
  15. The sooner you start coding a program, the longer it will take.
  16. A carelessly planned project takes three times longer to complete than expected; a carefully planned project takes only twice as long.
  17. Adding programmers to a late project makes it later.
  18. A program is never less than 90% complete, and never more than 95% complete.
  19. If you automate a mess, you get an automated mess.
  20. Build a program that even a fool can use, and only a fool will want to use it.
  21. Users truly don’t know what they want in a program until they use it.

Popularity: 62% [?]

Related posts:

  1. Unwritten Laws of Technology
  2. Computer Programming is Fun
  3. Christmas Computer Programming
  4. Best Programming Jokes
  5. 101 Great Computer Programming Quotes


42 Responses to “21 Laws of Computer Programming”

  1. Jo Says:

    #16 is ambiguous: is it twice as long as expected, or twice as long as the carelessly planned project?

  2. Arjan`s World » LINKBLOG for June 17, 2008 Says:

    [...] 21 Laws of Computer Programming – DevTopics Humoristic list with an undertone of reality [...]

  3. timm Says:

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

  4. Regan Johnson Says:

    Too true! Thanks for the list.

  5. tim Says:

    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

  6. timm Says:

    Having a bad day, tim?

  7. xman Says:

    all true…

  8. web design company Says:

    Murphy s law applied to programming!

  9. mikedopp - Mikes Links Monday 6/23/08 Says:

    [...] 21 laws of computer programming [...]

  10. UtopiaPlanetia » 21 laws of computer programming Says:

    [...] Taken from: http://www.devtopics.com/21-laws-of-computer-programming/ [...]

  11. Lunis Says:

    @tim

    They’re not interpretations. Any programmer knows that these are all true, sadly.

  12. G Says:

    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”

  13. Fredrik Says:

    “#17 Adding programmers to a late project makes it later.”

    LOL

  14. abev Says:

    It’s good to read these things coming from someone else. I ran into many of these problems and I just thought I sucked.

  15. Ashish Says:

    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!!!

  16. paresh Says:

    nice useful list.

  17. Las 21 leyes de la programación « Comunidad de Investigación de Software Libre de la USS Says:

    [...] el blog “DevTopics“, he encontrado estas 21 leyes de la programación, que ciertamente muchos desarrolladores de [...]

  18. Celina Says:

    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

  19. yamuna Says:

    really nice

  20. Shycon Design Says:

    Haha, thanks, that made me laugh… and cry at the same time.

  21. Anne Says:

    Wow. Good to know since I plan to get into programming.

  22. Pascal Says:

    not bad. I like the part about the obsolete statement, very satirical.

    Check this out for learning programming languages:
    http://www.codesplunk.com

  23. Tim D Says:

    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.

  24. Jeffrey Nonken Says:

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

  25. Thursday Links Roundup #6 - Putting Blogs First Says:

    [...] 21 Laws of Computer Programming – Unwritten ‘Laws’ of programming. [...]

  26. » 21 Laws of Computer Programming | oscarstech.com Says:

    [...] visit this link to see the rest. [...]

  27. Effectize Says:

    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…

  28. Things to make you go hmmm .... (laugh then think!) | Programming for Scientists Says:

    [...] 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 [...]

  29. Tim D Says:

    What are the laws which apply to people who use computers at home?

  30. rumesha Says:

    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

  31. Xstamper Says:

    ha! good list!

  32. Bob Foster Says:

    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.

  33. Unwritten Laws of Technology Says:

    [...] 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 [...]

  34. Twitter Trackbacks for 21 Laws of Computer Programming [devtopics.com] on Topsy.com Says:

    [...] 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 [...]

  35. JohnW Says:

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

  36. Carmen Says:

    LOL, I love this list, I especially believe #21. Great list.

  37. Igor Says:

    LOL How true

  38. Daemon Says:

    #8 Is simply beautiful. I’ll never know how a customer manages to do that with only presence !

  39. Elio Says:

    I’d love to see a project manager’s face while reading these laws!!!

  40. Projektowanie Stron Says:

    What are the laws which apply to people who use computers at home?

  41. Girraj Says:

    Thanks these lines r good to explain the computer laws.

  42. Hariom Siwach Says:

    Hi..
    This is good concept

Leave a Reply