savannah-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Savannah-dev] indentation


From: Nic
Subject: Re: [Savannah-dev] indentation
Date: 03 Sep 2003 11:54:49 +0100

Mathieu Roy <address@hidden> writes:

> Hi,
> 
> After discussion with the CERN team, we agreed to change this
> 
> function example () {
>         print "bla";
> }
> 
> if (1 != 1) {
>         print "blo";
> }
> 
> to
> 
> 
> function example () 
> {
>         print "bla";
> }
> 
> if (1 != 1) 
> {
>         print "blo";
> }
> 
> Which has the advantage of putting the corresponding { } on the same
> column. I think this is the GNU recommandation. If I'm mistaking,
> please tell me.

GNU coding style is not quite that, it would be better IMHO to use
GNU coding style which is this:


function example () 
{
   print "bla";
   if (1 != 1) 
     {
       print "blo";
     }
}
 
Top-level (ie: function) bodys are not indented, all other blocks are
indented. The indentation level is 2 spaces.

GNU coding style can be found online here:

http://www.gnu.org/prep/standards_toc.html

I recommend it.


Nic





reply via email to

[Prev in Thread] Current Thread [Next in Thread]