[clug] Think Pieces

Sam Couter sam at couter.id.au
Sat Jul 10 14:30:04 UTC 2021

On Sat, 10 Jul 2021, 20:36 jm wrote:

> any
> comment that conveys the intent of the code and how/what it's suppose to
> be doing

Code says what and how, comments are for why, and only when that's not
already clear.

In general if you feel the need to comment your code then your code is not
clear enough.

 can speed in finding problems when you're looking at the code

Or mislead because the comments are incorrect or out of date, or only make
sense after the code is understood because the same person with the same
poor communication skills wrote both the code and the comment.

Code is real, comments are just words. Comments are not executable, aren't
checked by the compiler or static analysis tools, aren't tested by unit
tests or human testers, aren't verified by the business. Spend the effort
on writing clear code instead.

More information about the linux mailing list