Quote Originally Posted by rgsparber View Post
Tony,

Here is an example of where the meaning isn't important:

Say I want to swap A and B:

qaz = A
A = B
B = qaz

These "keyboard" names would never be used outside of the immediate vicinity.

For names that are passed around, I like to use the initial caps format. For example, LongTermAverageFlowRate. It takes more typing, but like you said, in 5 years, it will still make sense. At my age, I will be confused tomorrow so need this long form.

Rick
Rick,

I started coding with Fortran back when you wrote programmes on fixed format paper forms. So there was limited space for a line of code and it was usual to use the shortest variable names possible. As it was engineering/scientific work names like x,y,z and i,j,k and a,b,c fitted the job quite well. With that background added to a healthy helping of laziness I carried the short variable naming through for decades. I have still a tendency to do that but I have realised that it is much quicker overall to use unambiguous descriptive names as you show. The extra time taken for the increased typing is way less than the time taken to understand a non-descriptive bit of code the day after you wrote it.
It was late when I replied to your post and to some extent i misunderstood your meaning of temporary. During development I often add "temporary" variables to monitor values. These are temporary in the sense that they are removed once the code is finished, I try to use meaningful names for these.
That use of "temporary" is, of course, different from that in your "swap A & B" example, where the temp. var. qaz is actually a permanent part of your code. Anyway I still don't like it and I'd use something like "temp" or "C" in similar situations, but hey "different strokes for different folks" is what makes life interesting.

BTW. the phrase "once the code is finished" is of course jocular.