C programming style

Tom Kessler tomk at ur-laser.uucp
Thu Jul 11 06:32:35 AEST 1985


>Maybe "i++" is clearer to you, but do you only write programs for
>yourself?  To me "i++" is the kind of statement typical of an APL-type
>language, not a language that is supposed to be structured and easy to
>understand.  "i++" could mean something else in another language.  But
>almost all high level languages (even APL) use some form of "i = i + 1"
>to increment a variable.  If I want to distinguish between incrementing
>and adding, then I would define a procedure such as "increment(i)",
>which can be immediately understood.

i don't know about you but my c compiler generates 3 fewer instructions
and does all of the adding in registers when i user i++ instead of i = i + 1.
-- 
--------------------------
		   Tom Kessler {allegra |seismo }!rochester!ur-laser!tomk
Laboratory for Laser Energetics               Phone: (716)- 275 - 5101
250 East River Road
Rochester, New York 14623



More information about the Comp.lang.c mailing list