kaldrenon said:
If, for example, "cleanUp" really means "close all connections" why
not rename it "closeAllConnections" and remove the comment?
[ . . . ]
For example, there's no significant difference in clarity between:
closeAllNetworkConnections
closeAllNetConnections
closeAllNetConns (unless you have reason to believe someone might
not recognize the abbreviation of Conns for Connections, but I
consider that common knowledge to a developer)
But IMHO, the last of these three is superior because it's clear
what it means, but it's shorter, which keeps the lines on which it
appears shorter, and is (slightly) less typing.
I suggest that the first of these is superior because it is very
explicit about the purpose of the method. Programmers reading the
code won't have to mentally expand any abbreviations and programmers
using the method won't have to try to remember which choice of
abbreviations the original programmer made: "Was that
closeAllNetConn(), closeAllNetConns(), closeAllNetworkConns(),
. . . ."