Hacker News new | ask | show | jobs
Ruby Metaprogramming Simplified (cheind.wordpress.com)
13 points by cheind 6020 days ago
Here is an approach to ease unleashing the power of Ruby’s metaprogramming.
3 comments

Changing the behavior of an existing class or method isn't really what people mean by metaprogramming, is it?
Well no not really. I guess you could use this lib for metaprogramming (code generation etc.), but I don't really see much benefit. This just seems to be an odd wrapper that doesn't make things more apparent (though that may be because I already know a good bit about Ruby and can't see with "n00b eyes").
I would hazard the suggestion that the library performs metaprogramming, and what it affords is a mental model for associating classes of entities with behaviour that is different from Ruby's out-of-the-box Smalltalk-like OO semantics.
I'm sure someone spent some time on this but I fail to see how things makes things easier or clearer. If anything it just muddies the waters. I know that metaprogramming can be hard to get your mind around sometimes, but you're much better off running through the existing material. If you keep at it eventually everything just clicks into place and you have that "ah-ha" moment. Takes a while but it's worth it.

Check out this link for some great resources (this has been posted on HN in the past): http://ruby-metaprogramming.heroku.com/

This is nuts. So, instead of learning the correct syntax to add behavior to a class or to an instance, you learn some library syntax instead?