Hacker News new | ask | show | jobs
by euphemize 3696 days 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.
2 comments

Even "temp" would be a standard name for the temporary variable used in a swap function.

https://en.wikipedia.org/wiki/Swap_(computer_science)#Using_...

Came 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.