Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!pasteur!agate!bionet!apple!desnoyer From: desnoyer@Apple.COM (Peter Desnoyers) Newsgroups: comp.lang.c Subject: Re: Standard Indentation etc. Message-ID: <22249@apple.Apple.COM> Date: 15 Dec 88 20:21:18 GMT References: <663@htsa.uucp> <832@husc6.harvard.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 35 My preference is : if () { ...statement ... } (plus various other things) I only feel strongly about a few indentation issues: (1) except in very special cases 'if () statement' should take 2 lines. Same goes for single-statement cases in a switch. (2) Gnuemacs can't find the beginning or end of a function unless the first and last braces are flush with the beginning of the line. Like everyone else said, having an indentation standard is more important than what the standard says. However, when you get into the topic of function and module headers, you will probably find more of a religious war, as everyone feels that their way is the one of truth, rather than just a bit more valid than everyone else's. These standards are crucial - you can't run code through a pretty-printer and get comments out. My feeling is that they should be flexible - decide on a list of things which can be described about functions, data structures, modules, etc. (e.g. function arguments, return value, side effects, global dependencies, references, description.) Then only require those elements relevant to a particular function be put in that function's header. That approach is close to what I find myself doing. It also avoids the trap mentioned in a previous discussion of coding standards - someone worked at a place where the mandatory function headers were so long that people combined functions to avoid writing headers. Peter Desnoyers