[haiku-commits] Re: r36596 - haiku/trunk/src/apps/packageinstaller

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 04 May 2010 15:05:54 +0200

On 2010-05-04 at 12:49:30 [+0200], Jérôme Duval <korli@xxxxxxxxxxxxxxxx> 
wrote:
> 2010/5/4 Stephan Assmus <superstippi@xxxxxx>:
> > On 2010-05-04 at 08:34:35 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
> > wrote:
> >> Stephan Aßmus <superstippi@xxxxxx> wrote:
> >> > Am Montag, den 03.05.2010, 18:40 +0200 schrieb Jérôme Duval:
> >> > > 2010/5/3  <superstippi@xxxxxx>:
> >> > > > -                               if (volume.IsReadOnly() ||
> >> > > > -                                               volume.
> >> > > > GetRootDirectory(&mountPoint) != B_OK)
> >> > > > +                               if (volume.IsReadOnly() || !
> >> > > > volume.IsPersistent()
> >> > > > +                                       || volume.
> >> > > > GetRootDirectory(&mountPoint) != B_OK) {
> >> > > >                              continue;
> >> > > > +                               }
> >> > > Why adding braces ?
> >> > Coding style requires it for multi-line if-statemens, which also goes
> >> > for if-statements where just the if-clause itself makes it multi-
> >> > line.
> >>
> >> Actually, this is not the case. It's just something you and Ingo do
> >> because you think it increases readability :-)
> >
> > It does not explicitely mention this case, but the only example that comes
> > close suggests the use of parenthesis, and I find it makes perfect sense.
> > Why make rules more complicated than they need to be?
> 
> To me this is clearly a single line statement "continue;", the
> condition readability is another thing.

This isn't directed at you in particular, Jérôme, but I have to say that I 
find these coding style discussions often frustrating and ridiculous. I 
absolutely agree that everyone should follow the style, and I am happy to 
point out style issues in patches from newcomers and even oldtimers. I 
dislike when code gets checked in that doesn't follow the style, but it's not 
the order of headers and similar things like how many blank lines after the 
copyright and whatnot that I find annoying. After a certain point it just 
gets ridiculous and counter-productive. As you point out yourself, you 
reserve judgement on readability of the multi-line if clause. That I always 
interpreted the rule the way I did is a clear indication that the coding 
guidelines are not clear "enough". What does "statement" refer to? I always 
thought the clause is also called a "statement". I've also pointed to the 
example and that it can be read the way I did. What more can I do? Does this 
really deserve the attention that it gets?

Best regards,
-Stephan

Other related posts: