Article View: comp.lang.eiffel
Article #1153Re: Hungarian notation
From: Richard Wesley
Date: Sat, 13 Jan 1996 03:07
Date: Sat, 13 Jan 1996 03:07
38 lines
2587 bytes
2587 bytes
In article <4csj8i$gsa@news.xmission.com>, tknarr@xmission.com ( Todd
Knarr ) wrote:
>In <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com>,
hawkfish@punchdeck.com (Richard Wesley) writes:
>
>>I've found it useful to use typedefs for all sorts of things like this.
>>Looping through a FooArray with a FooIndex is much more robust than using
>>a long or something.
>
>I try to avoid syntactic-saccharine typedefs when possible. There's no
>language-level gain from typedef'ing an int or long to something else
>just for that, and it virtually requires an explosion of variables to
>deal with multiple arrays of different types. The result of using several
>different variables to step through several different arrays at different
>times, just because those arrays have elements of different types, tends
>to be confusion. When the index is really significant then it makes sense
>to use seperate variables ( eg. when nCurrentMerchItem holds the index of
>the current item as other processing is done ), but as was pointed out
>there are a lot of constructions where the index is only significant for
>a line or two of code ( where your code is saying, basically, "Do >this<
>to every item in the array." ).
Unfortuantely, I've found that it is more than "syntactic-saccharine". One
of the things that drove me nuts when I was working with Windoze was that
no one had any idea how big an index was supposed to be. This caused me
more tahn one serious problem with overflow when 16 bit ints were used
instead of longs by people who weren't thinking.
- rmgw
http://www.punchdeck.com/hawkfish/PunchDeck.html
----------------------------------------------------------------------------
Richard Wesley | "Wind that frog!"
hawkfish@punchdeck.com | - Tom Hanks ("Toy Story")
----------------------------------------------------------------------------
Technical Details
Message-ID:
<hawkfish-1201961907010001@blv-pm11-ip27.halcyon.com>Path:
arc1-ca.pugleaf.net!blv-pm11-ip27.halcyon.com!userReferences:
<30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com> <1996Jan7.045815.8676@ohstpy> <4cpb00$nqk@news.xmission.com> <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com> <4csj8i$gsa@news.xmission.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!blv-pm11-ip27.halcyon.com!user From: hawkfish@punchdeck.com (Richard Wesley) Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3 Subject: Re: Hungarian notation Date: Fri, 12 Jan 1996 19:07:01 -0800 Organization: Punch Deck Consulting Message-ID: <hawkfish-1201961907010001@blv-pm11-ip27.halcyon.com> References: <30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com> <1996Jan7.045815.8676@ohstpy> <4cpb00$nqk@news.xmission.com> <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com> <4csj8i$gsa@news.xmission.com> NNTP-Posting-Host: blv-pm11-ip27.halcyon.com X-Newsreader: Yet Another NewsWatcher 2.1.2