Just curious to see what everyone does with naming variables and functions. How descriptive are you?
I for one have a three to four indicator in front of my variabes (i.e. strMyStringVar, intMyIntVar, etc.). As for functions, I usually put it descending order with functionality. In other words like User_Data_CalculateStuff().
So what do you do???
Page 1 of 1
2 Replies - 784 Views - Last Post: 04 May 2011 - 02:45 AM
Replies To: Your variable and function naming convention
Re: Your variable and function naming convention
Posted 04 May 2011 - 02:45 AM
I find that when I am coding, I tend to shorten words and not be very descriptive with my variable name. When I am writing a proper program (not just a quick script to test something) I don't really use one letter variables (except for loops. I think the quicker it is to write the variable the better, as long as I know what it is and can remember it, I don't think it needs to have a prefix. Although, when I do use two words for a variable instead of using the _ I find it is quicker to write them like lastName. For me it is just quicker to type, so I find it easier. But overall, I think it is a matter of what you prefer and if you know that other people will need to read your code. If I know someone else is going to be reading my code, I try to make the names as descriptive and easy to follow as possible.
Page 1 of 1