Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!bellcore!faline!sabre!gamma!mibte!cfpas!jhritz From: jhritz@cfpas.UUCP (John Hritz) Newsgroups: comp.lang.c Subject: Re: documentation standards for C Message-ID: <217@cfpas.UUCP> Date: Fri, 2-Oct-87 13:14:17 EDT Article-I.D.: cfpas.217 Posted: Fri Oct 2 13:14:17 1987 Date-Received: Tue, 6-Oct-87 06:15:29 EDT References: <9500@brl-adm.ARPA> <343@taux01.UUCP> <9232@slate.BBN.COM> Reply-To: jhritz@cfpas.UUCP (John Hritz) Distribution: world Organization: Chrysler FPAS, Southfield, MI Lines: 36 Summary: C Standards have little to do with brace placement In article <9232@slate.BBN.COM> mlandau@bbn.com (Matt Landau) writes: > >The things we really did have to specify included rules about relying on long >symbol names (don't), byte or word ordering (don't, or at least provide >ifdefs for all reasonable cases), or Rieser preprocessor tricks (don't), >including structured comments at the beginning of source files and functions >(which allow us to use trivial tools like grep to build indexes of what >functions are defined in a source file, etc.), conventions for preventing >multiple inclusion of .h files, and so on. Standards that we adhere to include not relying on whether the machine does hardware or software sign extension, encouraging the writing of modularized code, keeping the scope of variables as restrictive as possible, and managing project and system wide header files with an iron fist. Sign extension becomes a problem when performing right shifts on signed operands. If your system uses software to perform this function, you will get unreliable results. The benefits of modular code have been long argued. Here we maintain that the cost of calling more functions is paid back in ease of algorythm substitution. The construction and extension of a local function library cuts down on development time. The misuse of scope in variable declarations is also a common failing in large systems. We prefer to collect all functions requiring a pathological linkage in one file and making the variable static to the file rather than making global linkages. Many of the standards adopted by our groups are discussed in detail in the book, "C Programming Guidelines" by Thomas Plum. -- UUCP: ihnp4!mibte!cfpas!jhritz (John Hritz) "Do photons have mass?... VOICE: 313-351-3404 Are any of them Catholic?"