3 ms·
The 28 Bytes of Ruby Joy
- telemachos 16y agoMy initial reaction is that this is a bad idea. I would rather fail quickly than pass the nil along. But I'm curious what others think.
- spooneybarger 16y agoso this is basically a simplified version of the null object pattern with all its problems. http://en.wikipedia.org/wiki/Null_Object_pattern http://en.wikipedia.org/wiki/Null_Object_pattern it is worse than the null object pattern though as you have done it to your entire application. a better approach would be to determine when you have a hash that you want this behaviour from and implement a class for that specific behaviour rather than shotgunning it into everything.
- wgj 16y agoRaganwald does a nice job explaining the pitfalls (and to the OP's credit this was also linked from the original post.) http://github.com/raganwald/homoiconic/blob/master/2009-02-02/hopeless_egocentricity.md http://github.com/raganwald/homoiconic/blob/master/2009-02-0...