Re: Member Variables Naming Convention



Dave,

BTW, I found two interesting bullets in a Microsoft document [link below]
regarding the use of hungarian notation and the "_" prefix in field names:

Yeah, those were the ones I was thinking about. Microsoft is being very
one-sided about not using those prefixes. If you see where they talk about
control names, please pass it along.

I must argue here that my examples of txtFirstName and lblFirstName
indicate both type and semantics. However, I use the notation in other
controls even when there is no ambiguity, but I'm going to try to break
that habit for my next project. Do I really need to know that a field is
a Control by looking at its name when I have intellisense and tooltips on
hand at all times? - I don't think so, but I'll see how it goes ;)

I think it is still useful. Yes, Intellisense offers assistance here but I
often print code and review it in more detail. Also, for more complex code,
it may just be more efficient to know what a variable refers to just by
looking.

In the end, I have mixed feelings about this. I'm all for cleaning things
up, but I've been programming a long, long time and readability is
important. I'm not 100% sure I'm ready to abandon prefixes that tell me
about a particular variable.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


.



Relevant Pages

  • Re: Hungarian Notation
    ... > think that learning that many abbreviations is easy? ... not advocate a different prefix for every possible control variant. ... different prefixes in my code including query and datasource components. ... > *do* find reading HN harder. ...
    (borland.public.delphi.non-technical)
  • Re: Problems Saving Multiple Unbound Fields to a Table
    ... save yourself a lot of grief later on and assign more meaningful control ... e.g. normally you would only expect True and False in a CheckBox and ... code that provides for anything else - except as error trapping - ... The prefixes remove any doubt as to ...
    (comp.databases.ms-access)
  • Re: Hungarian Notation for Controls : Feature Request?
    ... out of prefixes and find it impossible to remember which prefix stands ... In addition, changing the type of control from, say, ... I wish that rather than heaping bell upon bell and whistle upon whistle ...
    (microsoft.public.vstudio.general)
  • Re: vb.net coding standards
    ... I'm not sure if I'd like Input and Control used alongside each other on ... this control allows changes to be made to the picture (therefore there ... >> although prefixes are useful in designer to find controls quickly. ... > TextBox userInput; ...
    (microsoft.public.dotnet.framework)
  • Re: VBA-Printer option
    ... Is there any ActiveX print control? ... We can't activate Printdialogbox ... I know how to write print code but the problem is users don't ...
    (microsoft.public.powerpoint)