<div class="gmail_quote">On Sun, Feb 20, 2011 at 22:58, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":8xc">PetscObjectDecreaseReference() and have it<br>
zero the pointer only if it got down to zero.<br></div></blockquote><div><br></div><div>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":8xc">
<br>
  I really hate code that does XXXDestroy(x) then XXXXSomething(x); it is fundamentally confusing</div></blockquote></div><br><div>Very confusing without a comment.</div>