Naming Conventions? 
Author Message
 Naming Conventions?

I'm working on a Standards document for use in our department.

Does anyone know if Microsoft has any suggested naming conventions for their
controls?

Currently I use an abbreviation if the control has one word or the first
letter of each word is the control name is made up of multiple words.  For
example:

btn = Button
lbl = Label
rfv = RequiredFieldValidator
dg = DataGrid
rb = RadioButton
ddl = DropDownList

This works for us programmers here but we have contractors come in every
once in a while and I'm looking for something that people most commonly use
to increase the maintainability of our apps.

Thanks,
Mark



Tue, 27 Sep 2005 01:12:57 GMT  
 Naming Conventions?
I have (once or twice) seen a listing of naming conventions in the back of
MS Press books; not lately though.

Be sure to extend this to database field names - I think prefixing db
variables is the most important thing to prefix, for clarity and also to
help ensure reserved name compatibility.  I've often seen a goofy field name
in an access database, but the second it is ported to sql or oracle or
something, that field name they used now conflicts with a reserved keyword.

txt or str for strings
int, num, lng, etc for various numeric formats..
bln or bit for bit type variables (or boolean, or whatever)..
guid for unique identifiers

frm for form.. cls for class prefixes (although I personally never prefix
classes because it makes em look ugly!)
txt for text fields, frm for frames.. opt for like radio buttons (or your rb
works too)
mnu for a menu, cb or chk for a check box; lst or lv for a list view
control; dg for data grid, or grd for an unbound grid.
tv for a treeview control, tab for a tab control, rtf for rick text control,
dlg for a dialog control (regardless of what type of dialog)..

I'll leave for others to add to the list - when you are done, you should
post the list back into this list - as it is helpful to the development
community.. I bet there's a "complete" list somewhere on the net, there HAS
to be.


Quote:
> I'm working on a Standards document for use in our department.

> Does anyone know if Microsoft has any suggested naming conventions for
their
> controls?

> Currently I use an abbreviation if the control has one word or the first
> letter of each word is the control name is made up of multiple words.  For
> example:

> btn = Button
> lbl = Label
> rfv = RequiredFieldValidator
> dg = DataGrid
> rb = RadioButton
> ddl = DropDownList

> This works for us programmers here but we have contractors come in every
> once in a while and I'm looking for something that people most commonly
use
> to increase the maintainability of our apps.

> Thanks,
> Mark



Tue, 27 Sep 2005 01:32:27 GMT  
 Naming Conventions?
Hi Mark,

The following link should answer this and any related questions:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpge...
ml/cpconnetframeworkdesignguidelines.asp

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
There is an exception to every rule...
Except this one.


Quote:
> I'm working on a Standards document for use in our department.

> Does anyone know if Microsoft has any suggested naming conventions for
their
> controls?

> Currently I use an abbreviation if the control has one word or the first
> letter of each word is the control name is made up of multiple words.  For
> example:

> btn = Button
> lbl = Label
> rfv = RequiredFieldValidator
> dg = DataGrid
> rb = RadioButton
> ddl = DropDownList

> This works for us programmers here but we have contractors come in every
> once in a while and I'm looking for something that people most commonly
use
> to increase the maintainability of our apps.

> Thanks,
> Mark



Tue, 27 Sep 2005 01:33:41 GMT  
 Naming Conventions?
The prefixes you listed are indeed intuitive.
However, you should keep in mind that such hungarian notation is somewhat
deprecated.
This mostly due to the overwhelming number of available controls and objects
available in the CLR.  You couldn't hope to come up with prefixes for them
all.  Additionally, the advanced editors these days such as Visual
Studio.NET will tell you object types just by hovering the mouse over the
variable, so prefixes are not as necessary as they use to be.
However in my opinion using a few basic prefixes as you've outlined isn't
likely to do much harm, and could help a wee bit.
Here's VS.NET documentation on Microsoft's offical stance:
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconRecommendationsForNamingComponen
ts.htm

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


Quote:
> I'm working on a Standards document for use in our department.

> Does anyone know if Microsoft has any suggested naming conventions for
their
> controls?

> Currently I use an abbreviation if the control has one word or the first
> letter of each word is the control name is made up of multiple words.  For
> example:

> btn = Button
> lbl = Label
> rfv = RequiredFieldValidator
> dg = DataGrid
> rb = RadioButton
> ddl = DropDownList

> This works for us programmers here but we have contractors come in every
> once in a while and I'm looking for something that people most commonly
use
> to increase the maintainability of our apps.

> Thanks,
> Mark



Tue, 27 Sep 2005 01:52:09 GMT  
 Naming Conventions?

Quote:

> > I'm working on a Standards document for use in our department.
> > Does anyone know if Microsoft has any suggested naming conventions for
> > their controls?

> The following link should answer this and any related questions:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpge...
> ml/cpconnetframeworkdesignguidelines.asp

Mark,
You can also use FXCop to check your .NET assemblies for conformance
to the .NET Framework Design Guidelines.
http://www.gotdotnet.com/team/libraries/

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com



Tue, 27 Sep 2005 06:01:19 GMT  
 Naming Conventions?



Quote:
> The prefixes you listed are indeed intuitive.
> However, you should keep in mind that such hungarian notation is somewhat
> deprecated.
> This mostly due to the overwhelming number of available controls and
objects
> available in the CLR.  You couldn't hope to come up with prefixes for them
> all.  Additionally, the advanced editors these days such as Visual
> Studio.NET will tell you object types just by hovering the mouse over the
> variable, so prefixes are not as necessary as they use to be.
> However in my opinion using a few basic prefixes as you've outlined isn't
> likely to do much harm, and could help a wee bit.
> Here's VS.NET documentation on Microsoft's offical stance:

ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconRecommendationsForNamingComponen

Quote:
> ts.htm

Hmmm, hovering a mouse over a printout of my VB code doesn't tell me what
the control is lol
Seriously though, as stated, the naming isn't really that important - it's
really just handy reference to whoever wrote the program.
If you enclose a list of your naming somewhere in your code (and stick to
it), then anyone else who looks at your code will also have a clear idea of
what each control is

Richie



Tue, 27 Sep 2005 19:38:06 GMT  
 Naming Conventions?
You still print out code?  How quaint.
Stop killing trees!
lol

Quote:

> Hmmm, hovering a mouse over a printout of my VB code doesn't tell me what
> the control is lol
> Seriously though, as stated, the naming isn't really that important - it's
> really just handy reference to whoever wrote the program.
> If you enclose a list of your naming somewhere in your code (and stick to
> it), then anyone else who looks at your code will also have a clear idea
of
> what each control is

> Richie



Wed, 28 Sep 2005 00:35:27 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Indexes - Primary key naming conventions

2. Universal Naming Convention.....

3. Naming Conventions?

4. Naming Conventions (pascal, camel, etc)

5. Naming Conventions -- Opinions please...

6. New Naming Convention

7. Naming conventions

8. Naming conventions

9. Standard Naming Conventions

10. Menu Naming Conventions

11. Naming Conventions: Avoiding Conflict

12. Naming Conventions

 

 
Powered by phpBB® Forum Software