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

  1. From: Barry.King@ttlg.UUCP (Barry King)
  2. Sender: TTLG@ttlg.UUCP
  3. Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!alberta!ttlg!TTLG
  4. Newsgroups: comp.os.os2.programmer
  5. Subject: SHORT, USHORT, and other absurdities
  6. Message-ID: <714508734.0@ttlg.ttlg.UUCP>
  7. Date: 22 Aug 92  12:07:25 mst
  8. Lines: 50
  9.  
  10. In a msg on <Aug 22 01:36>, Walter Bright of 42:1000/2 writes:
  11.  
  12.  -> /MRESULT EXPENTRY ClientWndProc (
  13.  -> /    HWND     hwnd,
  14.  -> /    USHORT   msg,
  15.  ->      ^^^^^^
  16.  -> /    MPARAM   mp1,
  17.  -> /    MPARAM   mp2)
  18.  
  19.  -> I've never understood this strange urge to #define the basic 
  20.  -> types. Is anyone out there using a compiler where USHORT 
  21.  -> would be anything other than "unsigned short"? How about SHORT 
  22.  -> being anything other than short, or LONG being anything other 
  23.  -> than long?
  24.  
  25. I guess I agree, mostly, but I do find it useful in that it takes less typing and 'fits in' with the general appearance of the rest of the types - they are all upper case...this is, I recognize, a personal asthetic kind of thing and comes from habit and indoctrination and no sound technical reason in this case.
  26.  
  27.  -> They remind me of the old practice (now discredited, after being 
  28.  -> discovered to be useless) of:
  29.  ->     #define BEGIN {
  30.  ->     #define END   }
  31.  
  32. This is just plain silly.  If someone wants BEGIN...END in their code, use Pascal...
  33.  
  34.  -> These silly typedefs create a useless layer of obfuscation and 
  35.  -> another potential source of error (I always have to check if 
  36.  -> SHORT really was short!)
  37.  
  38. Is this really a factor?  I've only ever had to do this when IBM or MS released a new version of their toolkits... ;-)
  39.  
  40.  -> Another brain-dead one is:
  41.  ->     #define FAR far
  42.  -> The argument I hear is that on systems without far, you can just 
  43.  -> do:     #define FAR
  44.  -> and it goes away! True, but why cannot one do:
  45.  ->     #define far
  46.  -> and achieve just as much portability?
  47.  
  48.  -> (P.S. I have running code that compiles and runs on 16 bit DOS, 
  49.  -> 32 bit DOS, 16 and 32 bit OS/2, Windows, Windows NT and 68000
  50.  ->  Macintoshes. Never have I needed those aliases for the basic 
  51.  -> types.)
  52.  
  53. Agreed.  Again, it is just a matter of asthetics for the simple types, IMNSHO.
  54.  
  55. Regards,
  56.  
  57. Barry
  58.  
  59.  * Origin: The OS/2 Connection - Edmonton, Alberta, Canada (42:100/31)
  60.