2 Replies - 784 Views - Last Post: 04 May 2011 - 02:45 AM

#1 SurfingShark  Icon User is offline

  • D.I.C Head

Reputation: 38
  • View blog
  • Posts: 188
  • Joined: 18-April 11

Your variable and function naming convention

Posted 03 May 2011 - 05:49 PM

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???
Is This A Good Question/Topic? 0
  • +

Replies To: Your variable and function naming convention

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9044
  • View blog
  • Posts: 33,951
  • Joined: 12-June 08

Re: Your variable and function naming convention

Posted 03 May 2011 - 06:05 PM

You may find this topic helpful as well:

http://www.dreaminco...-do-you-prefix/
Was This Post Helpful? 0
  • +
  • -

#3 Eric115  Icon User is offline

  • coderさん
  • member icon

Reputation: 63
  • View blog
  • Posts: 696
  • Joined: 19-January 09

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1