thebeebs | Say “No” to “Null”
thebeebs
Zeroing the desk - Ignore the design
 
 

Say “No” to “Null”

by thebeebs 4. May 2010 11:20

I Just read the blog post: Say No to Null and it was an interesting read but something about the idea of not handling Possible null exceptions rubs me up the wrong way.

The two reasons for not handling null were:

  1. Less code would need to be written.
  2. Code will look more elegant.

Neither of these two reasons satisfies my core values when developing code: Producing fast, Bug free code.

My null handling will remain the same. If I have 100% code coverage on the method and null parameters cause potential avoidable exceptions… I will fix them.

Tags:

Comments (4) -

Planky
Planky
6/10/2010 8:48:07 AM #

I read that article and was amused by this bit:

"In general, you should always strive to eliminate the passing of null rather than checking for null.  By doing so you reduce extra lines of code in each method, and are forced to use better design practices".

Like as if passing null and checking for null are mutually exclusive. You can strive for both... Belt and braces.

rift online gold
rift online gold United States
3/10/2011 8:18:03 PM #

This blog is so excellent.

rift gold
rift gold United States
3/12/2011 8:05:20 PM #

This blog is so excellent.

rift gold
rift gold United States
4/1/2011 2:29:16 AM #

very nice blog. Ready to hear more in the future.

Comments are closed