CS and the City

  • rss
  • Home
  • Resume

Offensive and Defensive Coding

Sean Lynch | September 13, 2006

Today’s coding practices tip (as if this is a regular thing) comes from Michael Feathers at Artima Developer. He writes an article on the perils of playing pass the hot null in your code:

“[using null checks] …just means that you’re dealing with bad code: you’re dealing with code where people are actively making extra work for themselves and making code brittle in the process.”

Read the entire piece here. Something I’ll have to consider. I’d like to see him flesh out his argument for using null objects such as empty arrays and strings rather than nulls. I see his point that it can help handle the exceptional case graceful, but I think that nulls may have their proper place. It’s easier to check for a null than to check if a string .equals(”").

Categories
Development
Comments rss
Comments rss
Trackback
Trackback

« Agile development in-a-box Review: Windows Live Writer Beta »

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Navigation

  • Business
    • Apple
    • Google
    • Microsoft
    • Yahoo
  • Canada
  • Copyleft
  • Development
    • Interfaces
    • Protocols
    • Python
  • How-to
  • Reviews
  • School
  • Technology
    • Gadgets
    • Software
  • Truthiness

Search

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox