The Best Code is No Code At All

Fred makes an excellent point with:

“When faced with a hunk of code someone else wrote, which doesn’t appear to be quite right, or is misbehaving, the proper action is to figure out what it’s supposed to do, and its interface, and then scrap it and start from scratch.”

For this, you need to add comments. Lots of programmers hate them: it slows you down, and you already know what the code is supposed to do–while you’re writing it. But what if you have to revisit the code 10 or 15 years later? It is NOT a nice feeling when you can’t figure out your own code.