Standards: How to name my enum and property sub variables

  • Thread starter Thread starter Alex Stevens
  • Start date Start date
A

Alex Stevens

Hi All,

In the absence of any predefined standards, I was wondering how to name and
implement my enum in a class.

My dilema is:

When I (for example) have an integer property in my class I'll use a class
level variable called mintCount and the property sub accepts a variable
called intCount and then assigns mintCount = intCount.

I use the int because the variable being accepted and stored is an integer.

How would I name my enum in the same way?:

I have:
Public Enum SQLType
Access2000
SQLServer
End Enum

I store the class level variable name as mSQLType, but I'm unsure how to
name the property sub variable?

Thanks

Alex
 
Alex Stevens said:
In the absence of any predefined standards, I was wondering how to name and
implement my enum in a class.

My dilema is:

When I (for example) have an integer property in my class I'll use a class
level variable called mintCount and the property sub accepts a variable
called intCount and then assigns mintCount = intCount.

I use the int because the variable being accepted and stored is an integer.

How would I name my enum in the same way?:

I have:
Public Enum SQLType
Access2000
SQLServer
End Enum

I store the class level variable name as mSQLType, but I'm unsure how to
name the property sub variable?

The name will depend on the semantics of the property. Your integer is
used to store a "count", that's why you call it 'intCount'.
 
Yes,

My dilema is what do I prefix my enum with, as it doesn;t have a type.....?

Alex
 
Alex,
In the absence of any predefined standards, I was wondering how to name and
implement my enum in a class.
Huh?

Design Guidelines for Class Library Developers (a.k.a. predefined
standards!).
http://msdn.microsoft.com/library/d...ef/html/cpconNETFrameworkDesignGuidelines.asp
I store the class level variable name as mSQLType, but I'm unsure how to
name the property sub variable?

If I named the field m_SQLType (the underscore is optional), I would name
the property SQLType.

http://msdn.microsoft.com/library/d...genref/html/cpconPropertyNamingGuidelines.asp

Hope this helps
Jay
 
Alex Stevens said:
My dilema is what do I prefix my enum with, as it doesn;t have a type.....?

Now I understand...

My Naming Guidelines and Code Conventions FAQ:

Visual Basic .NET Sample Guidelines
<http://www.gotdotnet.com/team/vb/VBSampleGuidelines.htm>

Naming Conventions for .NET / C# Projects
<http://www.akadia.com/services/naming_conventions.html>

Sheep .Net Naming and Style Convention: Introduction and References
<http://www.google.de/groups?selm=#YF7Ng3uCHA.572@TK2MSFTNGP12>

Naming Guidelines
<http://msdn.microsoft.com/library/en-us/cpgenref/html/cpconnamingguidelines.asp>

Design Guidelines for Class Library Developers
<http://msdn.microsoft.com/library/d...ef/html/cpconnetframeworkdesignguidelines.asp>

SharpDevelop C# Coding Style Guide 0.3
<http://www.icsharpcode.net/TechNotes/SharpDevelopCodingStyle03.pdf>
 
Back
Top