Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lanl.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!cmcl2!lanl!hwe From: hwe@lanl.ARPA Newsgroups: net.lang.c Subject: Re: c programming style Message-ID: <28448@lanl.ARPA> Date: Thu, 18-Jul-85 15:31:12 EDT Article-I.D.: lanl.28448 Posted: Thu Jul 18 15:31:12 1985 Date-Received: Sat, 20-Jul-85 10:03:42 EDT References: <11570@brl-tgr.ARPA> <935@teddy.UUCP> <289@greipa.UUCP> Organization: Los Alamos National Laboratory Lines: 30 The original purpose of: char *p; while (*p++)... was to allow the PDP-11 auto increment mode to be exploited. The code above would generate something like... tstb @(r0)+ while the code: while (*p) p += 1; would/could (depending on the smarts of the compiler) generate an "inc" instruction. In discussions of C, the following points should be remembered... 1. The inventors (Ritchie and friends) of C were GOOD assembly programmers who recognised the utility of the new-fangled structured concepts. 2. C was primarily a vehicle for VERY GOOD assembly language programmers to take advantage of the new structured programming while keeping the close-to-the-machine power needed (??) for system programming. While I do support active discussions of programming style, p++ vs p += 1 and so on, have deeper significance than just style. Skip Egdorf