[vtk-developers] Updates to VTK's coding standard page
David Thompson
david.thompson at kitware.com
Thu Mar 14 17:10:37 EDT 2013
Hi Kyle,
>>> ... I don't understand why we insist upon the following:
>>>
>>> * "[the STL] should be used sparingly"
>>> * "STL use should use the PIMPL idiom"
>>> * "When using anything declared in iostream, do not use std::"
>
> I think you may have misinterpreted my post. I have no desire to
> change any of the VTK coding standards. I was merely curious as to the
> "why" behind some of them.
I cannot say that this accounts for *all* of the reasons for those guidelines, but:
1. The STL should be used sparingly.
Compile times were (are?) noticeably higher when STL headers are included.
2. STL should be put in the private implementation.
Same as above: by keeping STL out of header files, dependent classes do not incur compile-time overhead.
3. Do not use std:: for iostream.
This is because of old MSVC compilers, some of which made cout, cerr, and some other iostream classes/instances available in the std namespace, some in the global namespace, and some attempted to make them available in both in a broken way.
David
More information about the vtk-developers
mailing list