Metaprogramming Concepts
Now that we have a few ideas about how metaprogramming can benefit you, we need to cover the basic concepts.
When working with metaprogramming, you get metadata for free from the environment it’s running in, and there is the opportunity to explicitly add more. With explicitness, you can enable clarity in your code base, and a level of transparency for the developers writing and reading the code.
Some parts of your source code will benefit from more explicit metadata rather than having it implicitly and just magically do things that can be hard for developers to reason about why.
With explicitness also comes the possibility of representing the domain language of your business in code and with increasing expressiveness.
In this chapter, we will be covering the following topics:
- Implicit – using what is already there
- Explicit – additional adornment of code
- Domain-specific languages
By the end of the chapter...