04 Apr '13, 8pm

"If you gaze into nil, nil gazes also into you"

The problem with nil is that it’s hard to know when to expect it. As a developer coming onto this project, or as a developer coming back to a piece of code after a while, it’s hard to know which methods might return nil. A method named membership_for sounds like it should return a Membership , not nil. Unless you dive through every method you call (and every method those methods call, and so on), you can’t tell if a nil might be returned somewhere down the line. Rather than adding the nil check in this one place and continuing to program in paranoid fear, let’s look at some possible solutions besides returning nil instead of a Membership.

Full article: http://robots.thoughtbot.com/post/8181879506/if-you-gaze-...

Tweets

@qrush see also

api.rubyonrails.org 05 Apr '13, 8pm

MessageEncryptor is a simple way to encrypt values which get stored somewhere you don't trust. The cipher text and initial...

@andrzejkrzywda

intridea.com 13 Apr '13, 2pm

Calling Methods on Potential Nil Objects in Rails By Raymond Law November 2, 2010 in rails Rails adds a pretty cool Object...

@LukeMaciak you can specify the :length also ch...

datamapper.org 10 Apr '13, 9am

key for a property. They can be static values, such as 12 or "Hello" , but DataMapper also offers the ability to use a Pro...

@ourcitylights @kaelahbee also this

@ourcitylights @kaelahbee also this

xiaxue.blogspot.com 03 Apr '13, 4am

With regards to my latest Plasticzilla entry, I've basically received these (bad) remarks: 1) Xiaxue you are just jealous....