[vtk-developers] About the vtkDataArray::InsertTuple() method

David Gobbi david.gobbi at gmail.com
Thu Mar 24 13:41:28 EDT 2016


On Thu, Mar 24, 2016 at 11:19 AM, David Lonie <david.lonie at kitware.com>
wrote:

>
> I wouldn't consider revamping the Insert behavior (or just removing the
> method) to be polish -- I'd consider it a bugfix. Array insertion has a
> well-defined meaning to developers, and this break from convention is a
> problem for new developers.
>
> They'll expect insert to insert, but instead it just sets. Their code
> looks correct, and they'll have a hell of a time trying to figure out why
> it isn't working at runtime until they either (a) start digging through
> documentation for what should be self-documenting APIs, or (b) step through
> the code with a debugger. At this point, they've wasted time tracking down
> this unconventional behavior just to find that VTK's methods don't behave
> as expected. It's incredibly frustrating to review your own code countless
> times trying to figure out what you did wrong, when in reality it's an
> external toolkit that's broken -- and it's worse when the brokenness is
> known and intentional.
>

This sums up my feelings on this particular API.

I'm all for adding new algorithms to VTK, but over the years I've seen
algorithms go into VTK with buggy, unstable, and even incorrect
implementations.  A poorly-understood API can easily lead to bugs.  The
vtkDataArray::Insert() methods are easily misunderstood (and IMHO
unnecessary) so they should be deprecated.

Personally, I wish that a lot more attention was paid to the bugtracker.
Stability/correctness of algorithms is very important to me (but, yeah,
speed is important too, and everyone knows that I've written crazy code at
times in order to save a few CPU cycles).

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160324/500e47c0/attachment.html>


More information about the vtk-developers mailing list