Rants, rambles, news and notes from another geek

"Why" Instead of "How" and "What"

Jimmy Nilsson writes:

If we transfer this little story to programming, it reminds me about that I think we should be asking ourselves “why?” when writing comments. If you also need to write comments for “how” and “what”, it might be a sure sign of smelly code and an indication that you need to do some refactoring.

Ahhh… that makes me feel good. Nice and simple. Comments should say WHY you did something. If you have to write WHAT or HOW, then you have a problem.

Thanks Jimmy!