tags:

views:

118

answers:

4

Sorry for a noobish question but I've stumbled upon some other person's code and he is using i_tmp2 inside of a for loop. When is the i_tmp2 notation used?

+2  A: 

Ask the person who actually wrote the code. Every individual programmer has their own reasons for choosing their notation styles for particular types of code.

Not Sure
A: 

It is used when the programmer isn't very good.

Oh come on, it's a joke.

rlbond
And you can tell this from one variable name?
Samuel
Yes you absolutely can tell this from one variable name. All good programming methods include strict rules on variable naming particularly the use of meaningful variable names. I always prefix variables with their type so at least it looks like he is doing that part right.
Nicholas Kreidberg
AHH HUMOR NAZIS!
André Neves
+6  A: 

i in i_tmp2 probably stands for "integer", i.e. telling you it's a variable used for storing whole numbers.

tmp2 in i_tmp2 probably just means it's the second temporary variable created.

Tobbe
I thank everyone who took the time to answer. I think this explanation comes closest to deciphering the meaning behind this variable naming.
Marin
A: 

There is a slightly outdated variabla naming convention called Hungarian notation, credited mostly to Charles Simonyi, a Hungarian programmer worked for Microsoft. With HN, the first character of the variable name is i for integer, l for long, w for word, etc. It is (was) useful with strongly typed languages to keep all the programmers remembering the type of the variables used/expected by functions.

Nowdays it is mostly out of fashion :)

Csaba Kétszeri