When you develop your art (I consider coding an art), you'll find that you'll establish your own naming conventions.
Like a guitar player who adopts certain styles from his / her heroes.
I haven't found any "official" naming convention recommendation that would suit me perfectly.
I think readability is the most important subject.
My personal rules are:
Private variables should start with _
.
Variables should use an abbreviated hungarian style, like s
for string
, i
for integer
, b
for boolean
, etc.
Variables passed to a function always start with an u
for me, and they have a very distinct name, like uCountItemsInAList
so that the the hungarian prefix doesn't have to be used because the type is relatively clear from the naming already. And variables passed to functions are already likely to be misinterpreted easily, so a long, very descriptive name is allowed in my opinion.
When I use a class only within a function, if the function is short, I start the class name with an n
.
I code like 16 hours a day, and I do it manically, so I think my answer can't be so "wrong". Although this topic is very subjective, I think readability can be considered a key factor, and my way of coding contains parts of all top coders that I was able to study so far.