News for hackers. Stuff that matters.
Re:Ruby's Exceptional Creatures by matheusmoreira on Monday January 29, 2024 @03:46AM (#39174163)
You keep saying method_missing is "bad" but what exactly is so bad about it?

The main complaint about method_missing has always been the inefficiency. The class hierarchy is walked every single time and only then is method_missing called. The use of define_method is a pretty neat solution to that problem. The method that wasn't found gets defined and it doesn't rely on method_missing again. Like a cache.

There are no comments on this comment yet.