Re:How to Create Meaningful Names in Code
by exabrial on Sunday September 01, 2019 @01:05PM
(#20853313)
> A good rule of thumb is: If a name requires a comment, then it doesn’t reveal the intent.
This can actually be extended to whole functions as well. doProcessMessage() is terrible but sendMailIfNewAccount() is an improvement.
We have a rule that we don't write comments, instead we write log messages, and we try to write them after every branch corresponds with a business decision.
This can actually be extended to whole functions as well. doProcessMessage() is terrible but sendMailIfNewAccount() is an improvement.
We have a rule that we don't write comments, instead we write log messages, and we try to write them after every branch corresponds with a business decision.