3 ms·
I think the challenge with "metaprogramming" is coming up with a good debugging model. The strength of functional programming is the ease of reasoning about th
by jimbokun 9y ago
I think the challenge with "metaprogramming" is coming up with a good debugging model.
The strength of functional programming is the ease of reasoning about the computation model. "This function is called with these arguments, and I can see it will then always return this exact result." Imperative programming makes predicting what a program will do much, much more difficult. Then metaprogramming can take understanding a program's behavior up another level of difficulty.
I experience this programming in Java with Annotation Oriented Programming (the preferred model of Spring). I find it even more difficult than Ruby "define method" or Lisp macros to deduce the behavior of a program. It's really hard to go from seeing an annotation in the program, to figuring out how exactly the annotation will change the program's behavior. In practice, it's pretty much just "Stack Overflow and Pray".