D
dhtapp
Hi,
One of the things I got accustomed to in Objective C was nil's behavior as a
universal message sink: You could send nil anything, and you'd get nil
back.
No big deal, really, except that it made message cascades (which in Ruby
would look like Java- or OGNL-style keypaths) a bit easier to code, without
having to stop off at every point in the path and use an if-statement to see
if there was a real object still listening. When I switched over to
predominately using Java a few years back, it took me a couple of painful
days to change that habit (not to mention remembering to use "null"
instead...literally the most besetting annoyance I inflicted on myself in
trying to learn Java).
Just curious: would it be worth petitioning the Power That Be for a global
switch that induced that kind of behavior in nil? Would there be any
catastrophic consequences? (Please be gentle; I still have only the
faintest clue what I'm doing with Ruby, except enjoying it a great deal...)
- dan
One of the things I got accustomed to in Objective C was nil's behavior as a
universal message sink: You could send nil anything, and you'd get nil
back.
No big deal, really, except that it made message cascades (which in Ruby
would look like Java- or OGNL-style keypaths) a bit easier to code, without
having to stop off at every point in the path and use an if-statement to see
if there was a real object still listening. When I switched over to
predominately using Java a few years back, it took me a couple of painful
days to change that habit (not to mention remembering to use "null"
instead...literally the most besetting annoyance I inflicted on myself in
trying to learn Java).
Just curious: would it be worth petitioning the Power That Be for a global
switch that induced that kind of behavior in nil? Would there be any
catastrophic consequences? (Please be gentle; I still have only the
faintest clue what I'm doing with Ruby, except enjoying it a great deal...)
- dan