[vtk-developers] Use of std::cout in tests

Bill Lorensen bill.lorensen at gmail.com
Wed Sep 19 16:52:59 EDT 2012


First, I believe we can use cout because somewhere i the vtk code there is a
"using std::cout".

In the C++ community there has been discussion about this.

1) using std; cout
2) using std::cout; cout
3) std:;cout

Our tests are taking advantage of a using std::cout somewhere in the
hundreds of .h files in vtk. I think this may cause users to think they
they can use cout, rather than std::cout in their apps.

Second, we have about 70 existing tests that use std::cout...

In my opinion. it doesn't seem to matter for the tests.

I'd rather spend time improving VTK's poor coverage.

Bill



On Wed, Sep 19, 2012 at 4:40 PM, Marcus D. Hanwell <
marcus.hanwell at kitware.com> wrote:

> On Wed, Sep 19, 2012 at 4:06 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
> > Folks,
> >
> > There has been some recent turmoil regarding the use of std::cout in
> tests
> > versus cout. The current style guidelines recommend the latter.
> > First, why is this even an issue. Second, can we amend the style to allow
> > std::cout? Much c++ code I see uses std::cout.
> >
> > I'd much rather spend time improving VTK'sl ow coverage that argue over
> what
> > seems to be a non-issue.
> >
> I guess I was the source of the aforementioned turmoil. I think it is
> important to stick to a common style, and actively changing test code
> to not match the style seems bad to me. I don't see the point in fully
> specifying std::cout when we have brought it into the global
> namespace, but if there is a strong feeling we should then my point
> was simply that we should specify that is the preferred style from
> this point forward (or that either is acceptable).
>
> If we all start modifying the VTK coding standards then our code will
> be far less consistent, and harder to understand due to using several
> styles. If there is general agreement on relaxing some parts of the
> style I really don't feel very strongly, but I think it should be done
> deliberately rather than on an ad-hoc basis.
>
> Where would you draw the line if this should be relaxed? Could
> standard indentation be used instead of the special VTK indentation in
> classes I author? I am sure we don't want to allow that, but it does
> require some definition on what is strictly required and what is
> advised/optional.
>
> Marcus
>



-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120919/489c05e7/attachment.html>


More information about the vtk-developers mailing list