Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site drivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!qantel!hplabs!amdahl!drivax!braun From: braun@drivax.UUCP (Karl Braun) Newsgroups: net.lang.c Subject: Re: C programming style Message-ID: <186@drivax.UUCP> Date: Mon, 15-Jul-85 13:04:13 EDT Article-I.D.: drivax.186 Posted: Mon Jul 15 13:04:13 1985 Date-Received: Thu, 18-Jul-85 06:36:20 EDT References: <11434@brl-tgr.ARPA> <303@ur-laser.uucp> Organization: Digital Research, Monterey, CA Lines: 21 > 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. > ... If I want to distinguish between incrementing > and adding, then I would define a procedure such as "increment(i)", > which can be immediately understood. var++ or ++var is a basic primitive of C. If you don't immediately comprehend what var++ means, then you don't know C (as in, haven't even looked at the manual). It is exactly equivelant to a procedure 'increment(var)'. Yes, maintenance costs more than original program development and it's costs should be weighed against development costs, but, as I think most C programmers would agree, this particular statement is so fundemental to the language that is kind of silly not to use it. The comment regarding the effeciency of the produced code is probably applicable to most compilers, but academically, any reasonable optimizer should optimize 'i = i + 1' to equivelant code. I guess the main point is this: if you don't understand 'var++' then you probably are not quite ready to be upgrading C code.