Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site ccvaxa Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!ccvaxa!preece From: preece@ccvaxa.UUCP Newsgroups: net.lang.c Subject: Re: C bites / programming style [if Message-ID: <2600012@ccvaxa> Date: Mon, 9-Sep-85 11:03:00 EDT Article-I.D.: ccvaxa.2600012 Posted: Mon Sep 9 11:03:00 1985 Date-Received: Thu, 12-Sep-85 10:39:53 EDT References: <418@phri.UUCP> Lines: 27 Nf-ID: #R:phri.UUCP:-41800:ccvaxa:2600012:000:1331 Nf-From: ccvaxa.UUCP!preece Sep 9 10:03:00 1985 > In my mind, the braces are associaed with the 'if' statment, and so > they should be indented at the same column as the 'if'. I look for the > closing brace in the same column to be a sort of 'statement terminator' > (i.e. when I see it, I think "Ah, the end of the if statement"). > /* Written 12:35 pm Sep 4, 1985 by mikes@3comvax.UUCP in > ccvaxa:net.lang.c */ ---------- Well, in my mind the braces are simply grouping the statements 'under' the if. I take the phrase "compound statement" seriously: what comes after the condition is a single entity made up of zero or more statements. Therefore I prefer to put the braces at the same indentation as the statements they bracket [actually, I prefer to leave the opening brace dangling on the same line as the condition, so that it doesn't leave an essentially empty line preceding the bracketed statements]. This style seems to ME to be closer to the ideal of having a way of grouping and distinguishing the grouped statements WITHOUT the syntactic cruft of the braces. This could be via indentation-as-syntax, font-as-syntax, or a tokenizing editor, take your pick. I see the braces as intrusive extraneous material needed because we lack proper means to express the structure of the program directly. -- scott preece gould/csd - urbana ihnp4!uiucdcs!ccvaxa!preece