3 ms·
Metaprogramming is just macros: code that generates code. One use is to get rid of repetitive code patterns. Another is to move certain computations to compile
by newen 8y ago
Metaprogramming is just macros: code that generates code. One use is to get rid of repetitive code patterns. Another is to move certain computations to compile time. Your statement that metaprogramming is used to solve a metaproblem is just wrong. Those two words are only related in that they share a prefix.
- TeMPOraL 8y agoThird is to introduce new concepts into your language as if they were part of that language from the get-go. Which can entail both eliminating repetitive code patterns and doing computation at compile time.
- karmakaze 8y agoI get what and why of metaprogramming. I was specifically trying to quantify working without it. My reference to metaproblem wasn't what metaprogramming you want to do but rather solving the problem of a lack of it by switching languages mid-development. How often has a commercial project been rewritten to gain metaprogramming mid-dev? I added commercial because personal projects have different objectives.