Should comments say WHY the program is doing what it is doing? (opinion on a dictum by the inventor of Forth)

Posted by AKE on Programmers See other posts from Programmers or by AKE
Published on 2012-10-31T21:56:56Z Indexed on 2012/11/01 17:16 UTC
Read the original article Hit count: 281

The often provocative Chuck Moore (inventor of the Forth language) gave the following advice (paraphrasing):

"Use comments sparingly. Programs are self-documenting, with a modicum of help from mnemonics. Comments should say WHAT the program is doing, not HOW."

My question:

Should comments say WHY the program is doing what it is doing?


Update: In addition to the answers below, these two provide additional insight.

  1. Beginner's guide to writing comments?
  2. http://programmers.stackexchange.com/a/98609/62203

© Programmers or respective owner

Related posts about coding-style

Related posts about code-quality