Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site teddy.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!teddy!rdp From: rdp@teddy.UUCP Newsgroups: net.lang.c Subject: Re: c programming style Message-ID: <935@teddy.UUCP> Date: Mon, 15-Jul-85 13:02:42 EDT Article-I.D.: teddy.935 Posted: Mon Jul 15 13:02:42 1985 Date-Received: Wed, 17-Jul-85 08:29:48 EDT References: <11570@brl-tgr.ARPA> Reply-To: rdp@teddy.UUCP (Richard D. Pierce) Organization: GenRad, Inc., Concord, Mass. Lines: 42 Summary: One of the points with the C i++ versus i = i = 1 issue is the one of pointers (although some alluded to it). Say we have some item like: main(argc, argv) int argc; char **argv; stepping through the array of pointers can be done by by incrementing a pointer: while (condition) /* or some other loop construct */ . . . argv++; This will get us to the next pointer, whereas, argv = argv + 1; will NOT (unless by the happy happinstance that a pointer is exactly the same size as a character!) The only equivalent "clear" statement would be: argv = argv + sizeof(char *); ! I am not fond of the i++ idiom myself, however, the original author severely oversimplified his case, I am afraid. After reading many dozens of messages going back and forth over this issue, my own conlusion is that one can program simply using the absolute minumum of idioms, one can cleverly use idioms that result in completely incomprehensible code, or one can design simply, properly use the tools available, and develop code that is conceptually simple, and uses the best of the tools in a way which is understandable, repairable and extendable.