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?
views:
118answers:
4Ask the person who actually wrote the code. Every individual programmer has their own reasons for choosing their notation styles for particular types of code.
It is used when the programmer isn't very good.
Oh come on, it's a joke.
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.
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 :)