7 ms·
"Don't comment bad code -- rewrite it." -- The Elements Of Programming Style by Brian Kernighan and P.J. Plauger. 1974. Until your code is as good as Kernighan
by gregjor 13y ago
"Don't comment bad code -- rewrite it." -- The Elements Of Programming Style by Brian Kernighan and P.J. Plauger. 1974.
Until your code is as good as Kernighan's you probably want to comment what you intended to do.
- _ZeD_ 13y agoKernighan does not say "don't comment good code"
- gregjor 13y agoYou can read what Kernighan wrote here: http://books.cat-v.org/computer-science/elements-of-programming-style/elements_of_programming_style.pdf http://books.cat-v.org/computer-science/elements-of-programm... Also see Software Tools and The Practice Of Programming.
- WayneDB 13y agoHe really doesn't say "don't comment good code". Reading page 141, he generally recommends that everyone should comment their code for non-trivial programs. Also, "One thing we will _not_ do is make pronouncements about how many comments a program should have."