The point here is not that metaprogramming is universally bad, it's that it should be used as a last resort ... and you should feel badyou could just refactor your code using static idioms
you or someone else will kill some runtime optimizations of the JIT.
syntax matters way less than people tend to think ... astonishment [sic] cute syntax
Many intelligent, design-savvy people would strongly disagree with you. Besides the obvious gains in the ability to create DSLs, there is a power and fluidity in metaprogramming that is not possible any other way.
Speed (as, say, provided by runtime optimizations from a JIT compiler) is not always critical. If it was, one probably should be using a language other than Ruby or Javascript; they're meant to be flexible, powerful languages, and their emphasis is not on pure speed.
Syntax is not "cute." Humans are going to read and use this code, and the more it reads like English, the more likely it is to be understood.
you could just refactor your code using static idioms
you or someone else will kill some runtime optimizations of the JIT.
syntax matters way less than people tend to think ... astonishment [sic] cute syntax
Many intelligent, design-savvy people would strongly disagree with you. Besides the obvious gains in the ability to create DSLs, there is a power and fluidity in metaprogramming that is not possible any other way.
Speed (as, say, provided by runtime optimizations from a JIT compiler) is not always critical. If it was, one probably should be using a language other than Ruby or Javascript; they're meant to be flexible, powerful languages, and their emphasis is not on pure speed.
Syntax is not "cute." Humans are going to read and use this code, and the more it reads like English, the more likely it is to be understood.