avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • January 20, 2019, 01:29 AM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Variable naming conventions  (Read 2573 times)


  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 228
    • View Profile
    • Donate to Member
Variable naming conventions
« on: May 05, 2006, 05:53 PM »
Well since I am trying to get back into coding, I guess I will get some opinions on a few things.  One thing I have always sort of struggled with, and have changed my method many times over the years, is variable naming.  My current way is pretty much a single letter to designate the datatype i expect to see in it (i for integer) and then a descriptive name, first letter of each word capitalized for enhanced readability.  I really have never worried much about standard conventions to facilitate others reading my code because, frankly I have never written anything anyone would ever want to read.  :)  But, who knows, if I can actually stick with it at some point I may be able to.

I also would like to see a few more threads on various, language agnostic if possible, ways to write code that is readable and such.  Also, maybe the more experienced guys (im looking at you Mouser!!) can give us some pointers on how to decide when to write functions to replace code blocks and when to just do it in place.  Here is one:  When do you write a class instead of a series of functions or methods?


  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 39,097
    • View Profile
    • Mouser's Software Zone on
    • Read more about this member.
    • Donate to Member
Re: Variable naming conventions
« Reply #1 on: May 05, 2006, 05:57 PM »
a book like "Code Complete" would be a good place to start:

there are also some good sites with programming style guidelines.. let's see what others come up with.


  • Master of Smilies
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 630
    • View Profile
    • Donate to Member
Re: Variable naming conventions
« Reply #2 on: May 05, 2006, 06:53 PM »
I second the Code Complete notion.  Excellent for thinking about such things.   :Thmbsup:
Insert Brilliant Sig line here