Re: To Hungarian or not to Hungarian
- From: "Rudy Velthuis [TeamB]" <newsgroups@xxxxxxxxxxxx>
- Date: 1 Nov 2007 13:01:43 -0700
Kevin Frevert wrote:
"Doug Chamberlin" <dougchamberlin at earthlink dot net> wrote in
message news:4729f83b$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Kevin Frevert wrote:
Is Hungarian notation really dead? What standards do you use?
Yes, it is generally frowned upon these days and has been for a
while.
The name should reflect the function or purpose of the item. Also,
in the teams I've lead and participated for quite a long time, the
scope of a variable is seen as the most important "addition" that
might be tacked onto the name. Therefore, we use a single letter
prefix that denotes whether the item is a parameter, a local
variable, a global variable, or a constant. For example,
Isn't Hungarian notation doing exactly what you are doing? Prefixing
something so it easier to identify the scope/type?
The type, but not the scope. I'd say that scope is much more important
than type.
I personally do not use prefixes for local variables. I generally write
short procedures and functions, and they should fit on one screen. I
also use short, but telling local variable names, although I have a few
fixed single letter names, like A for arrays, I and J for indexes, P
and Q for pointers, L for lists and S for strings.
Otherwise, I use the same kind of naming conventions as in the RTL and
VCL.
--
Rudy Velthuis [TeamB]
"Death is one of the few things that can be done as easily lying
down. The difference between sex and death is that with death
you can do it alone and no one is going to make fun of you."
-- Woody Allen.
.
- References:
- To Hungarian or not to Hungarian
- From: Kevin Frevert
- Re: To Hungarian or not to Hungarian
- From: Doug Chamberlin
- Re: To Hungarian or not to Hungarian
- From: Kevin Frevert
- To Hungarian or not to Hungarian
- Prev by Date: Re: Suggested changes to Delphi editor
- Next by Date: Re: Suggested changes to Delphi editor
- Previous by thread: Re: To Hungarian or not to Hungarian
- Next by thread: Re: To Hungarian or not to Hungarian
- Index(es):
Relevant Pages
|