more about programming style

Chris Torek chris at umcp-cs.UUCP
Tue Jul 30 14:03:36 AEST 1985


(Entering personal religious belief flammable mode)

Typedefs are very nice when applied sparingly.  Before you use
typedefs, figure out why some intrinsic type won't do---perhaps
the type will have to change on some machines, but once changed
will be fine (e.g., if you need 24 bit integers, perhaps int is
good enough, but maybe you need longs; perhaps you should use a
typedef).  Typedefs can also help if a complex type is used very
often.  Other than that they just it harder to figure out what's
really happening.

I think I overdid it when I wrote "win.h" (part of Maryland Windows):
it has a Win and a Buf (both aliases for structures, and maybe used
often enough), but also a Pos, which should never have got out---it's
not even used outside the structure definitions themselves....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.lang.c mailing list