Even better is naming things as intuitively as possible, and to use explanatory comments where they would be helpful.
Not trying to pick on you, but every time I see someone implying that "naming things better" is a panacea, I want to throw it out there that sometimes, nothing beats a good comment to explain (in natural language) what's going on here.
Re:Why don't they just..?
by nathan_long on Tuesday August 21, 2012 @03:50PM
(#4414419)
We're on the same page. Generally, I find that naming things better helps explain what the program is doing, and comments help explain why. And comments will stand out best if they are only used when needed to answer the question "why didn't they just..." :)
For example, you could have one 10-line method, interspersed with comments, or you could have a hierarchy of method calls, each with a name so clear that it needs no comments. The second method is less likely to get out of sync with what the code actually does, and it's more testable.
This the lesson that stuck with me most from Clean Code, which I highly recommend.