4 ms·
For what it's worth, and a bit OT, I find method_missing to be the least appealing part of Ruby's runtime dynamism. What _is_ helpful is to be able to add metho
by bguthrie 16y ago
For what it's worth, and a bit OT, I find method_missing to be the least appealing part of Ruby's runtime dynamism. What _is_ helpful is to be able to add methods on the fly (e.g., through define_method); on the other hand, being able to handle arbitrary messages (which is what method_missing does) is occasionally interesting (as with Rails' dynamic finders) but generally considered bad form given that there are clearer and more performant alternatives.
- KirinDave 16y agoI only mention the method_missing because most modern languages have fairly good answers to the "safely extend a type" problem, without succumbing to the problems that languages like Ruby suffer.