Syntax question

I see some codings that use:

motors instead of motors …what does "" do , is it for some purpose? I tried searching, but didn’t really have a term to search for…I only see this used once in a while, perhaps it has some significance.

That’s just a naming convention. I use the underscore myself to denote top level private variables that are use inside the class. Others use m at the start of the variable. All just a matter of preference really as long as the code is readable.

I use m_ which I’ve been told is a C++ convention, even though I was doing it long before I ever wrote any C++ code.

When I went to .NET training, the convention that was taught there was to use the underscore “" or "m” for the private fields in a class, and to drop those prefixes for the public accessors to those fields.

Nice brief doc on one of the used naming conventions:

http://www.dofactory.com/reference/csharp-coding-standards.aspx

I agree with Architect’s link. I’ve been doing this for a long time, 30+ years, and naming conventions that use Hungarian notation or prefix with underscores just seem old fashioned to me :wink:

Well, they ARE old fashioned. It’s taken me long enough to stop using lots_of_underscores_in_method_and_variable_names (from my early learning days in C) so I figure I can keep my m_ for a good while yet :wink:

Our company went through a phase of putting the scope and type in the variable name:

So I guess it was Hungarian + notation.

(this was from the VB6 days)

miValue = module integer
liValue = local integer
cmiValue = constant module integer

blech … glad that was a quick phase!