[vtk-developers] PROPOSAL: Changing VTK's indentation style

Shawn Waldon shawn.waldon at kitware.com
Wed Sep 9 09:53:26 EDT 2015


+1  It would be nice to have a format that doesn't require twiddling with
the editor(s) so much.  Having said that, I prefer that we do what Brad
suggested and use clang-format.  I've used it before on a project in grad
school and it was nice not having to worry about whitespace while coding
since I could just run a command to fix it at the end.

Shawn

On Wed, Sep 9, 2015 at 9:43 AM, Ben Boeckel <ben.boeckel at kitware.com> wrote:

> On Wed, Sep 09, 2015 at 09:22:37 -0400, David Lonie wrote:
> > Well, if we're changing it anyway...
> >
> > I'd prefer
> >
> > void func()
> > {
> >   if (...) {
> >     ...
> >   }
> >   else {
> >     ...
> >   }
> > }
> >
> > Less wasted vertical space = more code on the screen, and it's a common
> > style with great editor support. I've always been a fan of the Qt coding
> > style.
> >
> > https://wiki.qt.io/Qt_Coding_Style
> >
> > That said, either would be fine with me.
>
> I'm not too wedded to either (I personally prefer Allman for C++, but
> K&R braces for C, Rust, JavaScript, and other "braced" languages[1], though
> I've preferred using "} else {" to the style here[2]).
>
> No matter what, can we please (continue to) enforce that braces are
> *always* used even if the innards are a single line?
>
> --Ben
>
> [1]Rust, JS, and Java have style guidelines. C is usually because the
> projects in C I work on are contributions and copying upstream is best.
> [2]"Robin's egg blue is obviously better than turquoise" :P
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150909/13a58a67/attachment.html>


More information about the vtk-developers mailing list