I’ve been programming computers for twenty years. I’ve finally come to terms with the fact that I only know three things:
- your code will change
- no matter how simple you think your code is, it is complete nonsense to almost everyone else
- if you haven’t tested your code then it’s probably wrong
Do you have your own equivalent to the “Diggins Laws of Programming”?


hmm
4. java is slow
hmm
C programs have memory leaks
;-)
also . . .
4. Other people's code sucks
5. I will not go back later and fix it
6. It will take twice as long as I expect
also . . .
"I will not go back later and fix it" is better abstracted as "There is no 'later'."
Revised #2...
"no matter how simple you think your code is, it is complete nonsense to almost everyone else" should be:
"No matter how simple you think your code is, it is complete nonsense to almost everyone else, and in six months you'll come back to it and wonder what you were doing."
Revised #2...
how true :-)
also . . .
For me number 6 is definitely a keeper.
Revised #2...
Reminds me of a great, simple truth I will always remember: “It’s harder to read code than to write it.” That’s a quote from Joel Spolsky (http://www.joelonsoftware.com/) in the context of explaining why programmers always think code is a mess and needs rewriting (http://www.joelonsoftware.com/articles/fog0000000069.html) . I can’t say I always agree with Joel, but this short sentence has great elucidative power.
I believe understanding and coming to terms with this fact and all its implications is key to becoming a great programmer.
[Manual trackback from my blog entry (http://plasmasturm.org/log/320/) .]
So true
So true :-)
Revised #3...
3a: if you've tested it it's still wrong because you forgot to test one usecase noone even knew existed until it blew up the first day in production.
Revised #2...
Your code is too long. Revised version:
No, your code does not make sense.
:-p
Always
"Always write your code as if it will be maintained by a vicious psychopath who knows where you live."
changing code
There's good news in this:
If code is used, it will be changed.
Only unused code does not change.
How do we all make our living?