Enforcing Component Constraints
Brent Putman
putmanb at georgetown.edu
Fri Jan 27 14:47:16 EST 2017
On 1/27/17 2:17 PM, Cantor, Scott wrote:
> I have a much harder line on that, I guess. If something is annotated nonnull, that to me says the code should be able to operate as though it is a given that that variable is not null.
I agree that based on pure principle it "ought" to be able to operate
that way, of course. But ....
> That goes for everything, including subsequent uses of the variable as input to something else. If it's null, there was a bug in the original caller, and when it fails, that code will be fixed.
... in the meantime, if there is a bug in a caller, then your
production code blows up, maybe even doing Something Bad(tm).
I guess this question really just boils down to a philosophy of
"defensiveness" (or not) in the face of something that's nominally not
supposed to happen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20170127/1c7d33a1/attachment.html>
More information about the dev
mailing list