Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

… and ruins the life of future maintainers, there’s a reason few languages tried to borrow features from ruby’s metaprogramming (saying this as a rubyist)


Metaprogramming is powerful for making really nice, easy-to-use _libraries_. It shouldn't ever be used for business logic. Ever. Unless you're going to go all in and make a DSL for your business, but I don't know of anyone who actually does that.


Businesses are typically the ones hiring programmers (especially Ruby ones).

The smart programmers want to write libraries. This is actually a problem for businesses, because they often don't need libraries.


I agree. That’s a whole blog post or essay worth of shit to unpack there, though.


method_missing is only one tool in the metaprogramming toolbox (just probably the worst one). i wouldn't necessarily throw out the whole toolbox, particularly with ruby.


Any language feature can be misused. But without it things that are easy and useful become hard.


It really doesn’t have to. I believe this is from Smalltalk. Objective-C has something similar. It’s extremely powerful if used properly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: