Re: Member Variables Naming Convention
- From: "Dave Sexton" <dave@jwa[remove.this]online.com>
- Date: Sat, 18 Nov 2006 22:24:09 -0500
Hi Jonathan,
Hungarian notation isn't completely outlawed, however :)
Actually, in the Microsoft guidelines, it really is.
No, it's really not :)
Care to show me where Microsoft says that controls shouldn't be named with prefixes such as "txt" or
"lbl"?
(They are stored as private fields, you know)
--
Dave Sexton
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:ORhceA2CHHA.1224@xxxxxxxxxxxxxxxxxxxxxxx
Dave,
Absolutely. I mean, with C++, all strings should be wrapped in the _T() macro and every run-time
library routine and API appears to have both an ASCII and Unicode version. Clearly, the .NET
designers wanted to clean things up a little and, presumably, thought simple names were cleaner
than all this Hungarian notation, etc.
Hungarian notation isn't completely outlawed, however :)
Actually, in the Microsoft guidelines, it really is.
I see no mention in the standards about the use of "txtFirstName", for example, and I try to use
this notation when I need to distinguish between controls that would otherwise have identical
names, such as, "lblFirstName". Standardized prefixes are desirable, but I can live without
them.
Reference to controls is a bit different that straight variables. I haven't see what the
guidelines say about that.
Yeah, I can't do it. One thing (of many things) that annoy me about .NET is the verboseness.
Having suffered from carpel-tunnel issues from time to time, I'm not going to prefix every
occurrance of a member variable with five additional characters. I guess that is as good as any
argument for me to adopt the "_" prefix as my personal style.
Not every occurrence of a member variable.
I think consistency is important. Using the this. prefix only some of the time could get you into
trouble.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
.
- Follow-Ups:
- Re: Member Variables Naming Convention
- From: Jonathan Wood
- Re: Member Variables Naming Convention
- References:
- Member Variables Naming Convention
- From: Jonathan Wood
- Re: Member Variables Naming Convention
- From: Michael Nemtsev
- Re: Member Variables Naming Convention
- From: Jonathan Wood
- Re: Member Variables Naming Convention
- From: Dave Sexton
- Re: Member Variables Naming Convention
- From: Jonathan Wood
- Re: Member Variables Naming Convention
- From: Dave Sexton
- Re: Member Variables Naming Convention
- From: Jonathan Wood
- Member Variables Naming Convention
- Prev by Date: Re: Member Variables Naming Convention
- Next by Date: Re: Member Variables Naming Convention
- Previous by thread: Re: Member Variables Naming Convention
- Next by thread: Re: Member Variables Naming Convention
- Index(es):
Relevant Pages
|
Loading