On Sat, Jul 10, 2004 at 06:42:24PM +1000, Scott Smedley wrote:
> > >  * Please put single statements in loops or if clauses in curly
> > >    braces, i.e.
> > > 
> > >      if (1)
> > >      {
> > >        foo;
> > >      }
> > > 
> > >    not
> > > 
> > >      if (1)
> > >        foo;
> > 
> > What's the rationale behind this? I must confess I'm not particularly fond
> > of this restriction but I will, of course, follow any FVWM coding standards.

Maintenance.  It is easy to forget to add the curly braces when
you add another statement to a branch, at least if your editor
does not automatically indent the code.  There's not much else
behind it.

> >From docs/CONVENTIONS:
> 
>  o Always place curly braces on a separate line.  In some cases,
>    placing braces on the same line as other code confuses
>    (x)emacs.
> 
> Wouldn't it be prudent to fix Emacs?

The question is:  who is going to do it?  I don't know how to fix
it.  One case in which xemacs misbehaves is when you have such a
function:

  void foo(void) {
    ...
  }

If you press C-x 4 a to generate a ChangeLog entry, it does not
find the function's name.   That does not affect code inside the
functions.  Personally

 * I don't like braces on a code line because I have difficulties
   to find the matching closing brace if it's not in the same
   column.
 * I don't care much about code in places I rarely look at, but if
   I see such code in the files I maintain most of the time (most
   of the fvwm core), I reformat it.

> (That's an honest question, not trying to start an xemacs-vs-gvim war.)

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]

Attachment: pgpZ6tDOfHnoh.pgp
Description: PGP signature

Reply via email to