Geek Noise
Rants, rambles, news and notes by Peter Provost
11

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

Monday, 11 August 2003 15:24 by Peter Provost

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!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed