Re: Hungarian Notation for Controls : Feature Request?

From: Gerhard Menzl (gerhard.menzl_at_spambucket.net)
Date: 02/26/04


Date: Thu, 26 Feb 2004 09:51:10 +0100

Tony Nassar wrote:

> Nearly everyone uses some kind of Hungarian notation for controls,
> e.g., my form will almost certainly have variables named like
> "label1", "lbSomething", "m_lblSomething", etc.

Nearly everyone? Hungarian notation is now widely acknowledged as a bad
idea.

> Would it not be nice if the Forms Editor allowed you to set the prefix
> for every class of control, so that whenever you added a label, it
> would be named "lbl1," whenever you added a check box, it would be
> named "chk1", and so on?

With an ever growing numbers of custom controls, you would quickly run
out of prefixes and find it impossible to remember which prefix stands
for what. In addition, changing the type of control from, say,
TabControl to CoolTabControl would require you to rename all occurrences
of the respective variable manually.

I prefer my variable names to differ at the most significant end, i.e.
at the beginning: netConfigTab, not tpNetConfig.

I wish that rather than heaping bell upon bell and whistle upon whistle
the Visual Studio team would concentrate their efforts on delivering a
product that doesn't crash, take ages to display a form, and pester me
with stupid error messages like "object type cannot be converted to
target type".

Gerhard Menzl

--
Humans may reply by replacing the obviously faked part of my e-mail 
address with "kapsch".


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: Member Variables Naming Convention
    ... control names, please pass it along. ... often print code and review it in more detail. ... it may just be more efficient to know what a variable refers to just by ... I'm not 100% sure I'm ready to abandon prefixes that tell me ...
    (microsoft.public.dotnet.languages.csharp)
  • 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: walks, hikes
    ... Okay I won't mention control! ...  One of the parties needs to stop. ...  Blow the whistle - the parties ... So if I blow the whistle I communicating to them to stop. ...
    (uk.rec.scouting)