
Method_missing considered harmful. - mcantor
http://www.thingsfittogether.com/2011/08/methodmissing-considered-harmful.html?
======
jamesbritt
_It's better to explicitly create the methods you want using metaprogramming._

Almost.

If you know in advance what methods are going to be called then there's little
need to use _method_missing_

Anecdotally, the most common use-case is that you don't know exactly what
methods need to be handled at run time, but you have a good idea of the
boundaries. I.e. you're not planning on handling _every_ message sent to an
object, just those that meet some relatively narrow criteria.

Most likely these messages will be sent repeatedly, so rather than carry the
overhead of _method_missing_ each time, you can use metaprogramming to add
methods as encountered.

Depending on when in the object life-cycle these methods are added may or may
not address the concerns raised in the article.

 _Don't use method_missing to do metaprogramming. It's like writing an entire
website in the 404-handler of a web framework._

That would only be true if you used _method_missing_ to handle _every_ message
sent to all objects. In real life having smarter, dynamic 404 handling makes
sense.

In fact, most dynamic Web sites are based on the idea of run-time generation
of HTML where none previously existed. Add in caching and you have pretty much
what I just described for _method_missing_.

