Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] [egit-dev] Allow to always use blocks for if/while/for/do statements?

+1 This one got me in nearly every change I proposed ;)


> -----Ursprüngliche Nachricht-----
> Von: egit-dev-bounces@xxxxxxxxxxx [mailto:egit-dev-bounces@xxxxxxxxxxx] Im Auftrag von Andrey Loskutov
> Gesendet: Dienstag, 13. Januar 2015 00:08
> An: jgit-dev@xxxxxxxxxxx; egit-dev@xxxxxxxxxxx
> Betreff: [egit-dev] Allow to always use blocks for if/while/for/do statements?
> Hi,
> I was many times beaten during the reviews of my patches to j/egit projects
> because I always use blocks for all if/while/for/do statements, independently
> of their size, but j/egit coding style says "no braces should be used for one-
> line statements" [1].
> So this is OK for j/egit:
> if(bla)
>   doSomething();
> but this is NOT:
> if(bla){
>   doSomething();
> }
> I found this rule pretty annoying for many reasons: the rule itself is not
> only an exception from the general rule to have braces around any blocks but
> also contains another 2 exceptions that you *have to* use braces in some
> special cases. The code containing multiple if/else block with and without
> braces looks inconsistent, refactoring often leads to left-over braces.
> Especially that Eclipse formatter does not remove "unnecessary" braces
> automatically is kind of showstopper - one can't even trust Ctrl+Shift+F :-).
> Is there any strong reason to keep this rule or is it just matter of taste?
> Can we please relax the guidelines and remove this rule from the coding
> guidelines?
> [1]
> --
> Kind regards,
> _______________________________________________
> egit-dev mailing list
> egit-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz

Back to the top