long vs. int vs. short guidelines (especially for wizards!!)

Karlos Mauvtaque kvm at basser.SUN
Mon Apr 9 15:21:45 AEST 1984


You say don't use "int", ever.  Nonsense.  Here are my rules:

Use "long" if you really mean "long", (i.e. at least 32 bits,
argue if you like that "long" does not have to be at least 32
bits but any implementation with less will be very lonely,
nothing will work).

Use "short" only in data structures where you are concerned
about how much space you are using.  In other cases "int" is
always better because it is at least as big and "the natural
size suggested by the host machine architecture", i.e. faster.

Try changing your:

	register short	i;

loop variables to

	register int	i;

and you may not need that n-th VAX.



More information about the Comp.unix.wizards mailing list