Article View: comp.lang.eiffel
Article #1134Re: Hungarian notation
From: Todd Knarr
Date: Sun, 07 Jan 1996 20:38
Date: Sun, 07 Jan 1996 20:38
40 lines
2669 bytes
2669 bytes
In <1996Jan7.045815.8676@ohstpy>, vancleef@ohstpy.mps.ohio-state.edu writes:
>How often do you use NON-ZERO terminated strings??? HN is
>useless garbage in C++, or for ANSI C compilers.
Depends on what you're doing. I'm working on some stuff involving an
interface to hardware that requires counted strings because the string
to/from the device may legally contain embedded NUL characters. At a
higher level, we've got some "strings" that are really fixed-length arrays
of char, no delimiter because their length is always the same. ( Note that
I don't like them, and would prefer that they all become NUL-terminated
strings, but a few hundred thousand lines of existing code isn't going to
change just because of what I want ).
>HN is for rank amatuers IMHO, or Micro$oft employees :)
>BTW, how *do* you do HN in c++???
That's the big downside to HN: it simply cannot be sensibly extended to
deal with an arbitrarily large number of types, and it goes completely
insane dealing with polymorphism. I doubt anyone could come up with a
reasonable HN prefix to accomodate a variable that can be one of 9
different types at any given time.
I prefer prefixes that ignore type entirely and concentrate on purpose.
To me, the idea that a variable is a counter is more important than exactly
what size of counter it is. If I'm calculating an integral value, I like to
know if it's intended as an index into an array ( character strings come
to mind here ) as opposed to, say, the total hundredths of gallons of fuel
pumped from a pump. Pointers vs. arrays is about the only useful low-level
concept where HN works well, because in C++ you use them in very much the
same way but there are some critical semantic differences that sometimes
come up and bite you.
--
Todd Knarr : tknarr@xmission.com | finger for PGP public key
| Member, USENET Cabal
Seriously, I don't want to die just yet. I don't care how
good-looking they are, I! don't! want! to! die!"
-- Megazone ( UF1 )
Technical Details
Message-ID:
<4cpb00$nqk@news.xmission.com>Path:
arc1-ca.pugleaf.net!newsfeed.internetmci.com!xmission!newsReferences:
<30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com> <1996Jan7.045815.8676@ohstpy>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!newsfeed.internetmci.com!xmission!news From: tknarr@xmission.com ( Todd Knarr ) 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: 7 Jan 1996 20:38:24 GMT Organization: Chaos Central Message-ID: <4cpb00$nqk@news.xmission.com> References: <30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com> <1996Jan7.045815.8676@ohstpy> Reply-To: tknarr@xmission.com ( Todd Knarr ) NNTP-Posting-Host: slc122.xmission.com X-Newsreader: IBM NewsReader/2 v1.2