Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Oktokolo74526dI am pretty sure that Linus is dead serious about that style guide. Names matter.
I never call anything tmp.
Counters are trditionally called "i", "ii", or "iii" (but if there are three nested for loops you probably need to refactor that shit).
Temporary collections are most often "parts".
Temporary natural numbers are "n" or "m".
Coordinates are "x", "y", or "z".
But naming something "tmp" is a sure sign that you actually don't know, what it is (not only speaking of the data type).
ltlian148426dtmp is fine if it's obvious in the context. I would fire you the moment you start using tmp2 and higher in the same scope.
Lor-inc436526dAs a rule of thumb, for all inobvious/meaningless names (like tmp) I should be able to position the viewport such that all uses of the variable are included and every other visible name makes sense.
Yes, it would be tolerable in the really obvious cases. But i never had giving a proper name leading to code becoming less obvious. And if you understand what the code does (wich an obvious cases implies), better names come into mind automatically.
So i still would advice against using "tmp".