[petsc-dev] vec/vec/examples/tests/ex37.c "Nest vector functionality. has bugs

Jed Brown jed at 59A2.org
Sun Feb 20 16:07:35 CST 2011

On Sun, Feb 20, 2011 at 22:58, Barry Smith <bsmith at mcs.anl.gov> wrote:

> PetscObjectDecreaseReference() and have it
> zero the pointer only if it got down to zero.

Using this across the board probably also requires making it beginner level.
Part of the temptation of XXXDestroy() is that it is shorter (long names
take longer to read so it helps for common things to have short names) and
the explicit cast causes visual noise that obscures the actual argument of
the function and prompts the reader to confirm that the cast is indeed safe.
Removing the need for an explicit cast would reduce the noise, but I'm not
sure it's a good idea.

>  I really hate code that does XXXDestroy(x) then XXXXSomething(x); it is
> fundamentally confusing

Very confusing without a comment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110220/34cfb39b/attachment.html>

More information about the petsc-dev mailing list