3 ms·
Agreed with you. Perhaps if you're using temp or tmp, something could be done better, but I see no harm in using the others. If you're counting things, a variab
by euphemize 10y ago
Agreed with you. Perhaps if you're using temp or tmp, something could be done better, but I see no harm in using the others. If you're counting things, a variable named "count" sound perfectly reasonable to me.
- smellf 10y agoEven "temp" would be a standard name for the temporary variable used in a swap function. https://en.wikipedia.org/wiki/Swap_(computer_science)#Using_a_temporary_variable https://en.wikipedia.org/wiki/Swap_(computer_science)#Using_...
- riprowan 10y agoCame here to say this. I bumped my head hard on this part of the text - the whole point of using a cliche is that it's immediately understandable. When I come across an incrementing loop that doesn't use a cliche variable like "count" or a function that doesn't return "return" it increases my mental tax. The nice thing about using a variable like "count" or "return" throughout your function is it's immediately intuitive what's going to happen with this variable.