long vs. short names - (nf)

mwm at ea.UUCP mwm at ea.UUCP
Fri Aug 24 08:02:00 AEST 1984


#R:druky:-74000:ea:13500022:37777777600:981
ea!mwm    Aug 23 17:02:00 1984

/***** ea:net.unix-wizar / druky!ewh /  5:34 pm  Aug 20, 1984 */
re: long vs. short identifiers; it seems to me that with a bit of
judiciousness, one can have it both ways:
	instead of doggoneid1 being confused with
		   doggoneid2 in a truncating compiler, if you declare them
like this:	   1doggoneid and
		   2doggoneid, ie, make the unique part first instead of last,
then you have portable long ids.  see any holes kids?  ernie harkins
/* ---------- */

This is a cog-eng flavored problem, and exists outside of C. I first
ran into it in FORTRAN, with the real, reliable 6-char names. Some
user had exchanged (by accident) DVELX and DVELY in a routine call. He
had just mis-read the names. If he had used XDVEL and YDVEL, the difference
would have been obvious.

Conclusion: Place the distinguishing part of near-identical names at the
*front* of the name. This also helps avoid (but doesn't solve, as I've
discovered) the variable variable-name length problem in C.

	<mike



More information about the Comp.unix.wizards mailing list