|
|
|
|
|
by klauserc
666 days ago
|
|
I once had the questionable pleasure to write code in an environment where "at most one method call per statement" was strictly enforced. Had to constantly come up with names for intermediate values that would only get used once, in the very next statement. It has kind of radicalized me against "pointless names". Names take up valuable space in the working memory of the reader. They need to carry their weight. |
|
I've seen streams-like code with a variable for almost every step, immediately used the line below. I can understand when the reason is to "explain" the meaning of the intermediate step...but even so a comment is far better on my opinion.
I always try to inline every 1-use variable/method, unless there is a good reason for not doing so.