Re: Hungarian notation pros vs cons
- From: Ken Wilson <kwilson.dev@xxxxxxxxxxxxx>
- Date: Fri, 03 Feb 2006 11:28:53 GMT
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
.
- Prev by Date: Bitmap printing through a NetworkStream
- Next by Date: Re: Compaing two arrays when element order does not matter
- Previous by thread: Re: Hungarian notation pros vs cons
- Next by thread: Re: Hungarian notation pros vs cons
- Index(es):
Relevant Pages
|