Re: Hungarian notation pros vs cons

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 31 Jan 2006 09:27:35 -0800, "Andy" <ajohnstone@xxxxxxxxxxxxxxxx>
wrote:

Some counterpoints:

1. Not sure what you mean exactly by 'knowning which objects are
yours..' If your code is using them, they are all yours. If you want
to know if they are defined in libraries you wrote, the IDE can tell
you that.

2. this isn't a concern, because Employee (the web page class) should
be in a different namespace than Employee (the business object). You
would have to fully qualify one (probably the BO), so there's more
typing, but only when you declare the object or are tryign to cast it.
And technically, shouldn't your page be called formEmployee; after all,
you DO have a class that represents the aspx page.

3. System seems to be a pretty bad choice for a class name; it doesn't
really tell you anything about what the class does. Does system
represent a plumbing system? A network system?

4. Again, fully qualifying your classes should resolve this. Thats
why the concept of namespace was introduced.

I don't like hungarian notation because:

A. Its alot more typing; namespace conflicts are much more rare, so
its hard to justify that EVERY instance object have some extra
characters thrown in.

B. Your methods shouldn't be pages and pages long. If you're doing
proper OO design, each method should be fairly short, rarely taking up
more than 10 lines or so...making it really easy to look further up the
screen to double check what you're dealing with by looking up (or by
hovering your mouse of the name of the vairable).

Even if your methods are long, if your aren't declaring your variables
until you absolutely have to they shouldn't really be too far from any
code you be working on I suspect.

Ken Wilson
Seeking viable employment in Victoria, BC
.



Relevant Pages

  • Re: XML Validation: Declaration not found for element
    ... XML Validation: ... any of those mistakes is enough to cause a namespace or local name mismatch. ... declare namespace d="http://t/transactionBlob/MainXMLSchema.xsd";; ... definition couldn't be found in the XML schema collection. ...
    (microsoft.public.sqlserver.xml)
  • Re: Re: Re: SQLXML Namespaces
    ... > namespace, so SQLXML has declared an arbitrary prefix for the ... > the results you can declare any prefix you like and the XML ... >> Your schema must have a default or target namespace ...
    (microsoft.public.sqlserver.xml)
  • Re: C is too old? opinions?
    ... you may very well end up in trouble typing that. ... _ or an UPPERCASE letter is the implementation's namespace). ... And no need for a trailing underscore at all. ... header guards should have a unique format that is not ...
    (comp.lang.c)
  • Re: Does declaration of a class as public mean anything?
    ... > no reason to declare it. ... reason to specify public visibility. ... could have put it in an unnamed namespace. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Hungarian notation pros vs cons
    ... But what about in the database where you can't organize by namespace? ... Even if namespaces didn't solve this, Employee would be a bad ... >> Does anyone disagree with using Hungarian notation? ... > 4) It's inconsistent with the rest of the framework. ...
    (microsoft.public.dotnet.languages.csharp)