"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 :)
by Mr eel — Oct 31
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 :)