🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2365

Re: Braces (was: Initialization of automatics within loops)

#2365
From: Doug Gwyn
Date: Tue, 05 Feb 1991 20:25
35 lines
1622 bytes
In article <2293@inews.intel.com> bhoughto@hopi.intel.com (Blair P. Houghton) writes:
>Digression:  does anyone know where this style (having the
>statements aligned with the braces that enclose them) came
>from?  Before a few months ago I'd never seen it, and now
>I've seen it in a dozen programs.  Who's fomenting this
>bletcherous bowdlerization of my beloved C?

Several programmers around here have come to use that style.
The most logical indentation would be
	while ( ... )
		{
			...
		}
but most agree that with 8-column tab stops this indents too far,
thus
	while ( ... )
		{
		...
		}
as an acceptable compromise.
	while ( ... )
	{
		...
	}
is another form of compromise that is fairly often seen.
	while ( ... ) {
		...
	}
has little to recommend it other than being the style used in K&R.
There are several other minor variations, including some that few
programmers would find reasonable.

There is no point in reopening this old style debate.  You
might ask yourself why you haven't been exposed to more
variation in C coding style before now.
Technical Details
Message-ID: <15090@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!purdue!haven!adm!smoke!gwyn
References: <1991Feb5.023809.389086@locus.com> <2293@inews.intel.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!purdue!haven!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Braces (was: Initialization of automatics within loops)
Message-ID: <15090@smoke.brl.mil>
Date: 5 Feb 91 20:25:51 GMT
References: <1991Feb5.023809.389086@locus.com> <2293@inews.intel.com>
Followup-To: comp.lang.c
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 35