473,799 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Standards: How to name my enum and property sub variables

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
Nov 20 '05 #1
5 6936
"Alex Stevens" <al**@matrixinf otech.co.uk_nos pam> scripsit:
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'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Yes,

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

Alex

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
"Alex Stevens" <al**@matrixinf otech.co.uk_nos pam> scripsit:
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'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

enuEnumerator

Alex Stevens wrote:
Yes,

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

Alex

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
"Alex Stevens" <al**@matrixinf otech.co.uk_nos pam> scripsit:
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'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
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/de...Guidelines.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/de...Guidelines.asp

Hope this helps
Jay

"Alex Stevens" <al**@matrixinf otech.co.uk_nos pam> wrote in message
news:O6******** ******@TK2MSFTN GP10.phx.gbl... 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

Nov 20 '05 #5
"Alex Stevens" <al**@matrixinf otech.co.uk_nos pam> scripsit:
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.c om/team/vb/VBSampleGuideli nes.htm>

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

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

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

Design Guidelines for Class Library Developers
<http://msdn.microsoft. com/library/default.asp?url =/library/en-us/cpgenref/html/cpconnetframewo rkdesignguideli nes.asp>

SharpDevelop C# Coding Style Guide 0.3
<http://www.icsharpcode .net/TechNotes/SharpDevelopCod ingStyle03.pdf>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
2741
by: James Harris | last post by:
Before I embark on a new long-term project I'd appreciate your advice on how to split up long names. I would like to keep the standards for command names the same as that for variable names. Looking at the examples below, which ones seem better? Straight names echoclient lastcharoffset helloworld Internal underscores
144
6979
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this initiative. Typically I find that coding standards are written by some guy in the company who has a way of coding that he likes and then tries to force everybody else to write code the way he likes it, not for any rational reason, but simply for the...
13
12395
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
20
7013
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt = document.getElementById('hometab'); Has anyone ever seen anything like this before, or am I dreaming?
19
3979
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4. Framework-Specific Guidelines Naming Conventions and Styles
2
4765
by: Charlie | last post by:
I use a file to define all of my global variables, data.c, and then I create a header file, data.h, where I reference all the variables with the keyword "extern." I include the header in every file. I define an enum and variable of that type in data.c, enum myenum { val1, val2,
10
3041
by: Charlie | last post by:
I tried to post this before and I apologize if I am repeating myself, but I do not see the post anywhere. But anyway, I have a file, data.c, where I define all of my global variables. I then use the extern keyword to reference those variables from a header file, data.h, which I include in every file. I am defining an enum type and variable in data.c:
12
22763
by: Charlie | last post by:
I have a file, data.c, where I define all of my global variables. I then have a header file, data.h, which I include in every file in which I reference all of the variables defined in data.c. For the most part, I am having no problem with this. However, I defined an variable of type myenum in data.c: enum myenum {
4
3968
by: =?Utf-8?B?SmFzb24gUmV5bm9sZHM=?= | last post by:
(using .net 2.0) Say you have a class structure like this: class Address .... end class class Person FirstName
0
9540
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10250
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.