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.
Share and Enjoy:
  • Twitter
  • Facebook
  • Reddit
  • LinkedIn
  • Digg
  • DotNetKicks
  • StumbleUpon
  • Slashdot
  • Technorati
  • Google Bookmarks
  • Print
  • email

Article published on June 17, 2008




58 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: https://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

  43. laptop asus Says:

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

  44. Tecnología y negocios » Las 21 leyes de la programación Says:

    […] el blog "DevTopics", he encontrado estas 21 leyes de la programación, que ciertamente muchos […]

  45. Jssay Says:

    not every one is fit for me, but still thanks.

  46. [译稿]软件编程21法则[转] | 隔叶黄莺 Unmi Blog Says:

    […] 任何程序一旦部署即显陈旧。 修改需求规范来适应程序比反过来做更容易。 一个程序如果很有用,那它注定要被改掉。 一个程序如果没用,那它一定会有很好的文档。 任何程序里都仅仅只有10%的代码会被执行到。 软件会一直膨胀到耗尽所有资源为止。 任何一个有点价值的程序里都会有至少一个bug。 原型完美的程度跟审视的人数成反比,反比值会随着涉及的资金数增大。 软件直到被变成产品运行至少6个月后,它最严重的问题才会被发现。 无法检测到的错误的形式无限多样,而能被检测到的正好相反,被定义了的十分有限。 修复一个错误所需要投入的努力会随着时间成指数级增加。 软件的复杂度会一直增加,直到超出维护这个程序的人的承受能力。 任何自己的程序,几个月不看,形同其他人写的。 任何一个小程序里面都有一个巨大的程序蠢蠢欲出。 编码开始的越早,花费的时间越长。 一个粗心的项目计划会让你多花3倍的时间去完成;一个细心的项目计划只会让你多花2倍的时间。 往大型项目里添加人手会使项目更延迟。 一个程序至少会完成90%,但永远完成不了超过95%。 如果你想麻烦被自动处理掉,你得到的是自动产生的麻烦。 开发一个傻瓜都会使用的软件,只有傻瓜愿意使用它。 用户不会真正的知道要在软件里做些什么,除非使用过。 [英文出处]:21 Laws of Computer Programming […]

  47. 21 Laws of Computer Programming « Xinyustudio Says:

    […] Original post is here. […]

  48. 21 Laws of Computer Programming [Citation] | 人生如旅 Life is a journey! Says:

    […] Laws of Computer Programming [Citation] Posted on 2010-10-07 by Nocky Original: https://www.devtopics.com/21-laws-of-computer-programming/ ( They may be not all true laws, but all good suggestions worthing to be thinking about. […]

  49. 软件编程21法则 | New Start Again Says:

    […] [英文出处]:21 Laws of Computer Programming 计算机 ← 给盲目兴奋的程序员们的建议 Leave a comment0 Comments. […]

  50. Linux Tutorials 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.

  51. 21 Laws of Computer Programming | Create&Ext Says:

    […] [英文出处]:21 Laws of Computer Programming [译文出处]:外刊IT评论 […]

  52. 软件编程21法则 | edwardlauxh Says:

    […] [英文出处]:21 Laws of Computer Programming This entry was posted in Software Engineering. Bookmark the permalink. ← SQLServer中xxxx用户登录失败的解决方法 成为一名优秀程序员所需要知道的那些事 → LikeBe the first to like this post. […]

  53. Linkspun down - AskDamageX.com Webmaster Forum Says:

    […] for the update jdoughs. I always consult this law whenever I make updates or implement something new __________________ Trade Expert icq 437 […]

  54. WinKey « net eamelje Says:

    […] van de praktijkwetten die software-ontwikkelaars hebben geformuleerd, gaan over de merkwaardige neiging van programmatuur […]

  55. 关于计算机编程的21条“规律” | 薄荷脑de技术博客 Says:

    […] 原文:21 Laws of Computer Programming […]

  56. I'm Ych » Blog Archive » 软件编程21法则 Says:

    […] [英文出处]:21 Laws of Computer Programming […]

  57. Lawyer in Miami Says:

    Designed for the bring up to date dough’s. I for all time discuss with this commandment on every occasion I compose update or execute amazing fresh.

  58. Bankruptcy lawyer florida Says:

    They’re not interpretation. whichever programmer know to facilitate these are all accurate, unhappily.

Leave a Reply