Tuesday, December 05, 2006

Comments

DO NOT write comments to comment what the code does; use short method and self-descriptive method name to explain it.

DO NOT write comments to comment when the code should be used; use assertion to not only describe it but force it too.

DO NOT write comments to comment how the code should be used; use design pattern to communicate it.

Write comments to comment why the code is written the way it is.

No comments: