Re: To Hungarian or not to Hungarian



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.
.



Relevant Pages

  • Re: Private variables question
    ... already in use at a higher scope. ... but if those three lines reference a variable that is declared ... Local variables are always named and referenced with a lower case ... help in such cases even if you have a prefix. ...
    (borland.public.delphi.non-technical)
  • Re: Free Will
    ... scope for choosing how we live. ... suicide, much like the final outcome of cancer is death, I think perhaps ... she was born she was very welcome - she was born in free will. ...
    (soc.religion.quaker)
  • Re: Free Will
    ... scope for choosing how we live. ... suicide, much like the final outcome of cancer is death, I think perhaps ... she was born she was very welcome - she was born in free will. ...
    (soc.religion.quaker)
  • Re: Pyserial again
    ... Richie Hindle wrote: ... at this point we're getting into application design issues unless and until Luca can learn enough Python and other programming stuff to understand why "ser" is "going out of scope" ... If you don't know about object construction and destruction, memory allocation and garbage collection, the concept of "scope" and the difference between things like local variables, global variables, and attributes, we're going to continue to have an exceptionally difficult and frustrating time helping you. ...
    (comp.lang.python)
  • Re: VB 6.0 Desktop - Global Variables
    ... variables are not "slower" than local variables. ... wide scope", then this kind of variables only can live in a module. ... standard code module. ... without needing a reference to an object. ...
    (microsoft.public.vb.general.discussion)