[vtk-developers] vtk-developers Digest, Vol 147, Issue 6

Andrew Maclean andrew.amaclean at gmail.com
Mon Jul 4 19:07:15 EDT 2016


I had a look at that article and two things really jump out (in quotes
here):
-------------------------------------------------------------
"The first thing that leapt out at me when looking at the full source of
sslKeyExchange.c was a lack of consistency.

It bears all the hallmarks of a file which has been worked on by multiple
developers who were not bound by a single set of comprehensive coding
standards.
Immediately noticeable when the file is opened in an ordinary text editor
(not a code editor or IDE), is that the indentation inconsistently mixes
tabs and spaces.

The second thing I realised (relevant given the nature of this bug) is the
inconsistency with regard to single-line conditional blocks. There are
places where a conditional statement is enclosed in braces even when it is
only a single line, and other places where it is not."
-------------------------------------------------------------
So yes, it is probably worthwhile looking at brace spacing etc.

One of the strengths of VTK is its consistent coding style which does make
it easy to spot bugs. So I agree with you Sean, lets adopt a coding style
consistent with modern tools and then git hooks can be implemented
supporting this. vtk_reindent_code.py goes a long way towards doing this.

It is frustrating at present that I have to manually modify spacing etc.
since my main editors are Visual Studio, Sublime text3 using
SublimeAStyleFormatter and sometimes Eclipse and QTCreator.

Have a great Wednesday! Wish I lived closer.

Regards
   Andrew



---------- Forwarded message ----------
> From: Sean McBride <sean at rogue-research.com>
> To: Bill Lorensen <bill.lorensen at gmail.com>, Paolo Quadrani <
> paolo.quadrani at gmail.com>
> Cc: VTK Developers <vtk-developers at vtk.org>
> Date: Mon, 4 Jul 2016 17:41:53 -0400
> Subject: Re: [vtk-developers] Incorrect indentation by vtk_reindent_code.py
> On Mon, 4 Jul 2016 15:57:46 -0400, Bill Lorensen said:
>
> >First, I have mixed emotions about massive changes to fix brace
> >spacing. Who benefits? Some developers, yes, the customer, no.
>
> Bill, I take your point, but missing braces and screwed up whitespace can
> cause real bugs, the most famous recent example being the goto fail bug:
> <https://blog.duncanworthy.me/swdev/ios/apple-ssl-goto-fail-bug/>
>
> VTK's Whitesmiths style isn't supported by modern tools, and once we get
> away from it we can do things like autoformatting, git hooks that reject
> incorrect formatting, dashboard check of formatting, etc.
>
> See you guys Wednesday!
>
> Cheers,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
>
-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160705/476c7589/attachment.html>


More information about the vtk-developers mailing list