3 ms·
I posted a response to a similar comment somewhere else a while back, which I'm copy/pasting here: It could just be my experience, but from what I’ve seen, a l
by jlarocco 11y ago
I posted a response to a similar comment somewhere else a while back, which I'm copy/pasting here:
It could just be my experience, but from what I’ve seen, a lot of Lisp coders treat advanced macro programming like magic. It’s one of those things you “can” do, but rarely “should,” precisely because it’s so easy to misuse and potentially difficult to understand. There are some popular libraries (like Iterate) that use macros to do far out stuff, but most people write macros themselves pretty infrequently. Even Paul Graham, in “On Lisp” suggests writing macros, “when nothing else will do,” like when conditional evaluation is required.
On the other hand, my experience with Ruby was that everybody wanted to do meta-programming everywhere because it was the hot new thing and made Ruby like Lisp, and made you look smart and clever. The more a person could abuse meta-programming to twist the language, the better.
For example, here’s a Ruby tutorial explaining how to use method_missing to auto-generate methods that match a regular expression, and at the end: “we’ve created an extremely expressive and beautiful API that is DRY and easy to maintain.”
- throwaway801 11y agoI believe this is the article (or part two of it): http://www.sitepoint.com/ruby-metaprogramming-part-ii/ http://www.sitepoint.com/ruby-metaprogramming-part-ii/ Not only does Ruby do metaprogramming poorly, but Rubyists have managed to give it a bad name by too often metaprogramming for the sake of metaprogramming, like in that article.
- jlarocco 11y agoOops! Thank you, that's the one!