Design Element
Comment on "Attribute Values in Rails"
by Mr eel — Oct 31
"Speaking of which, I was surprised that sending messages to nil generates exceptions in Ruby, at least in Rails development mode. I think ignoring nil messages saves a lot of time in Objective-C."

Well, if you're calling an accessor of an ActiveRecord instance -- to say, write it's value into an input -- you might be a bit surprised if no errors get generated and yet the input doesn't have a value in it (if you were expecting one anyhow).

Having those error messages has helped me out a few times.

In what circumstances would you be sending messages to nil often enough to want errors supressed? I'm not familiar with Obj-C so that seems... intriguing :)
Back to "Attribute Values in Rails"
Design Element

Copyright © Scott Stevenson 2004-2015