Exceptions vs method missing in Ruby and Rails

After some looking around here is what i found and thought others would find useful as well
Exceptions in general are really slow in ruby and should be thought of as exceptional. method_missing is not an exception but is actually a kernel method of ruby. When you invoke a method on ruby the runtime will search the entire class and module heirarchhy all the way to object, class and module and then as a last case call method_missing. Its more like it just calls this method and you can override this method at anypoint in the chain. Its definitely slower than calling a method that does exist because it has to search up the heirarchy but it is definitely faster than exceptions.
Here are some other posts that i found useful during my review of this area:
Be Sociable, Share!
This entry was posted in tech and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Warning: Invalid argument supplied for foreach() in /var/www/l8ent/wp-content/plugins/mention-comments-authors/mention-comments-authors.php on line 106