🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1206

SHORT, USHORT, and other absurdities

#1206
From: Barry King
Date: Sat, 22 Aug 1992 19:07
50 lines
2324 bytes
In a msg on <Aug 22 01:36>, Walter Bright of 42:1000/2 writes:

 -> /MRESULT EXPENTRY ClientWndProc (
 -> /    HWND     hwnd,
 -> /    USHORT   msg,
 ->      ^^^^^^
 -> /    MPARAM   mp1,
 -> /    MPARAM   mp2)

 -> I've never understood this strange urge to #define the basic 
 -> types. Is anyone out there using a compiler where USHORT 
 -> would be anything other than "unsigned short"? How about SHORT 
 -> being anything other than short, or LONG being anything other 
 -> than long?

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.

 -> They remind me of the old practice (now discredited, after being 
 -> discovered to be useless) of:
 -> 	#define BEGIN {
 -> 	#define END   }

This is just plain silly.  If someone wants BEGIN...END in their code, use Pascal...

 -> These silly typedefs create a useless layer of obfuscation and 
 -> another potential source of error (I always have to check if 
 -> SHORT really was short!)

Is this really a factor?  I've only ever had to do this when IBM or MS released a new version of their toolkits... ;-)

 -> Another brain-dead one is:
 -> 	#define FAR far
 -> The argument I hear is that on systems without far, you can just 
 -> do: 	#define FAR
 -> and it goes away! True, but why cannot one do:
 -> 	#define far
 -> and achieve just as much portability?

 -> (P.S. I have running code that compiles and runs on 16 bit DOS, 
 -> 32 bit DOS, 16 and 32 bit OS/2, Windows, Windows NT and 68000
 ->  Macintoshes. Never have I needed those aliases for the basic 
 -> types.)

Agreed.  Again, it is just a matter of asthetics for the simple types, IMNSHO.

Regards,
 
Barry

 * Origin: The OS/2 Connection - Edmonton, Alberta, Canada (42:100/31)
Technical Details
Message-ID: <714508734.0@ttlg.ttlg.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!alberta!ttlg!TTLG

Show Full Headers
Complete Article Headers
From: Barry.King@ttlg.UUCP (Barry King)
Sender: TTLG@ttlg.UUCP
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!alberta!ttlg!TTLG
Newsgroups: comp.os.os2.programmer
Subject: SHORT, USHORT, and other absurdities
Message-ID: <714508734.0@ttlg.ttlg.UUCP>
Date: 22 Aug 92  12:07:25 mst
Lines: 50