Skip to content

Metaprogramming — Junior

Decorators, annotations, reflection, macros, and generators make code act on code. First prefer ordinary functions and data. Use metaprogramming when a stable repeated pattern exists and generated behavior remains testable and discoverable.

Test yourself

  1. Can a normal function solve it?
  2. When does generation happen?
  3. Can a debugger show the behavior?

Continue to middle.md.