• SyntaxError (unregistered) in reply to MiserableOldGit

    In terms of handling nulls, as a general rule I choose to try to avoid pushing it onto the caller so they don't have to. A NullPointerException should mean programmer error... the source of where it was generated will determine which programmer error (callee or caller), regardless of where it came from it should be fixed, and preferably by not just slapping in a "if (val == null)" or variation of that expression. Sometimes its unavoidable, other times it can be. BTW, I am not a fan of the Null/Empty object "pattern" as it often is confusing or just kicks the can down the road for someone else to deal with. Most modern languages have idiomatic ways to handle this (Optionals for instance).

Leave a comment on “All the Small Things”

Log In or post as a guest

Replying to comment #:

« Return to Article