DEV Community

Discussion on: Laziness I: Meta-programming

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

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.

Collapse
 
mcsee profile image
Maxi Contieri

ok. But they bring a lot of trouble as described on the article, so it should be used with caution