home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11486 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  2.1 KB

  1. Path: sparky!uunet!decwrl!netcomsv!ulogic!hartman
  2. From: hartman@ulogic.UUCP (Richard M. Hartman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Hungarian notation
  5. Message-ID: <142@ulogic.UUCP>
  6. Date: 22 Jul 92 23:14:55 GMT
  7. References: <1992Jul20.084316.15691@druid.uucp> <1992Jul20.220701.1095@trl.oz.au> <1992Jul20.224424.20551@aplcen.apl.jhu.edu>
  8. Organization: negligable
  9. Lines: 42
  10.  
  11. I think a lot of the strength behind the Hungarian fetishists is
  12. the fact that the MS Windows calls and variables all use Hungarian
  13. notation.
  14.  
  15. The concept of Hungarian (i.e. put a short prefix on variable names
  16. so that some sort of typing information is available when reading code
  17. without requiring the user to flip back four-or-five pages to find
  18. out whether "index" is an int or a char) is good, as long as it is
  19. consistantly used.  I have seen some people imply that if you use
  20. Hungarian notation you can't make variable names that say what it
  21. is used for (a file position vs. some other type of int was mentioned).
  22. That is a ridiculous argument -- nFilePos vs nStudentCount -- there,
  23. it's been done.  And using Hungarian yet!
  24.  
  25. The problems I have with it are 
  26.  
  27.     1) people who want to use overly long "type" prefixes
  28.         (e.g. "char charC, charInitial, charInput")  This
  29.         just causes a whole bunch of typing!
  30.  
  31.     2) the lack of any one central reference standard, I have
  32.         seen both "n" and "i" used as the prefix for integers,
  33.         there has been talk of "sz" and "strz", and some old
  34.         fashioned folks using "pc" for pointer to arrays of
  35.         characters (strings).  Some people like to add "a"
  36.         for array (e.g. anChapters for an array of integer
  37.         chapter numbers).  It seems that any group of 
  38.         programers, once they agree to use the concept have
  39.         to further agree on just what set of prefixes they
  40.         will be using!  (Of course, if there were a central
  41.         reference, it would probably be Simyoni (sp?), and
  42.         he favors the longer prefixes I already griped about
  43.         in item #1! :)
  44.  
  45.  
  46.  
  47.         -Richard Hartman
  48.         hartman@uLogic.COM
  49.  
  50. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  51. Disco isn't dead...            ...it's just in witness protection!
  52.  
  53.