Meta-programming is magic. That is the main reason why we should not use it. There are many dire consequences on the horizon.
Meta programming isn't any more magical as real programming. But instead of programming the behaviour of the program, it extends the programming language to allow more fitting abstractions and vocabulary to describe the program.
Also consider that there's no hard line separating meta-programming from language compiling. Many features of modern languages differ from metaprogramming only in that they are implemented on a compiler level, but come with all the same downsides, except they're more standardised.
Just like objects are a few layers of abstraction on top of machine codes, meta-programs are just another level of abstraction that can make code easier to write and read.
Bad abstractions can, of course, hurt maintainability more than they help, but that applies both to meta-programs and language-features, so it's not an exclusive problem of meta-programming.
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
Meta programming isn't any more magical as real programming. But instead of programming the behaviour of the program, it extends the programming language to allow more fitting abstractions and vocabulary to describe the program.
Also consider that there's no hard line separating meta-programming from language compiling. Many features of modern languages differ from metaprogramming only in that they are implemented on a compiler level, but come with all the same downsides, except they're more standardised.
Just like objects are a few layers of abstraction on top of machine codes, meta-programs are just another level of abstraction that can make code easier to write and read.
Bad abstractions can, of course, hurt maintainability more than they help, but that applies both to meta-programs and language-features, so it's not an exclusive problem of meta-programming.
ok. But they bring a lot of trouble as described on the article, so it should be used with caution