home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / programm / 4381 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.6 KB

  1. Path: sparky!uunet!nwnexus!ole!rwing!fnx!nazgul!bright
  2. From: bright@nazgul.UUCP (Walter Bright)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: SHORT, USHORT, and other absurdities
  5. Message-ID: <910@nazgul.UUCP>
  6. Date: 22 Aug 92 01:36:40 GMT
  7. References: <1992Aug10.162757.13720@thyme.jpl.nasa.gov> <19920811.003756.988@almaden.ibm.com>
  8. Reply-To: bright@nazgul.UUCP (Walter Bright)
  9. Organization: Zortech, Seattle
  10. Lines: 34
  11.  
  12. In <1992Aug10.162757.13720@thyme.jpl.nasa.gov> Kaleb Keithley writes:
  13. /Question 1: Given the following code fragment...
  14. /MRESULT EXPENTRY ClientWndProc (
  15. /    HWND     hwnd,
  16. /    USHORT   msg,
  17.      ^^^^^^
  18. /    MPARAM   mp1,
  19. /    MPARAM   mp2)
  20.  
  21. I've never understood this strange urge to #define the basic types. 
  22. Is anyone out there using a compiler where USHORT would be anything
  23. other than "unsigned short"? How about SHORT being anything other
  24. than short, or LONG being anything other than long?
  25.  
  26. They remind me of the old practice (now discredited, after being discovered
  27. to be useless) of:
  28.     #define BEGIN {
  29.     #define END   }
  30.  
  31. These silly typedefs create a useless layer of obfuscation and another
  32. potential source of error (I always have to check if SHORT really was
  33. short!)
  34.  
  35. Another brain-dead one is:
  36.     #define FAR far
  37. The argument I hear is that on systems without far, you can just do:
  38.     #define FAR
  39. and it goes away! True, but why cannot one do:
  40.     #define far
  41. and achieve just as much portability?
  42.  
  43. (P.S. I have running code that compiles and runs on 16 bit DOS, 32 bit
  44. DOS, 16 and 32 bit OS/2, Windows, Windows NT and 68000 Macintoshes.
  45. Never have I needed those aliases for the basic types.)
  46.