![]() |
Macros vs. Blueprints: How to Choose |
Both features reduce repetition. The difference is scope and output: macros expand inline; blueprints generate full blocks per argument. This guide helps you decide quickly and confidently.
Aspect | Macros | Blueprints | Best Use |
---|---|---|---|
Expansion | Inline at each @macro |
Generates one block per argument via %generate |
Macros: small inserts Blueprints: full modules |
Typical Size | 1–10 lines | 10+ lines | Use size as a heuristic |
Param Handling | Placeholders with defaults | Placeholders, .lcase/.ucase/.ccase , sequences |
Blueprints for complex naming patterns |
Composition | Can call other macros | extends and prepends |
Blueprints for layered templates |
Copies Emitted | One expansion per use | N copies (one per argument) | Prefer macros to avoid duplication when possible |
%expand on/off
during validation to inspect generated code.
Hide Description
|
|
Enter or modify the code below, and then click on RUN |
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |