Macro: Code that runs at compile time to generate or transform other code before it is compiled/executed. A macro is code that runs before or during compilation to generate or transform other code. It lets you write a short instruction that expands into a larger piece of code. In C, macros are simple text substitution. In Rust, macros like println! and vec! work on the structure of code. Lisp macros are famously powerful, because Lisp code is itself data that macros can rewrite freely.
Macros remove repetitive code and can add new language features. The trade-off is readability and debugging, because the code that runs is not quite what you wrote. PHP and JavaScript have no compile-time macros, but code generators, Babel transforms and Laravel's runtime macro() method for extending classes fill a similar role. Use them where they remove real repetition, not to be clever.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.