1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [Macro](<https://delaparra-services.nl/knowledge-hub/macro>)

  

Category: Programming paradigms 

# Macro

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is Macro?

 

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.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about Macro

  

### What should you keep in mind with Macro?

 

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.

 

## At a glance

   CategoryProgramming paradigms Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Programming paradigms terms

 

- [Literate Programming](<https://delaparra-services.nl/knowledge-hub/literate-programming>) 
- [Location Transparency](<https://delaparra-services.nl/knowledge-hub/location-transparency>) 
- [Logic Programming](<https://delaparra-services.nl/knowledge-hub/logic-programming>) 
- [Mailbox](<https://delaparra-services.nl/knowledge-hub/mailbox>) 
- [map / filter / reduce](<https://delaparra-services.nl/knowledge-hub/map-filter-reduce>) 
- [Message Passing](<https://delaparra-services.nl/knowledge-hub/message-passing>)

 

[All terms starting with M](<https://delaparra-services.nl/knowledge-hub#letter-m>)

 

## Skills

 

- ### Architecture Patterns

 

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.

 [View skill](<https://delaparra-services.nl/skills/architecture-patterns>) [Download zip](<https://delaparra-services.nl/skills/architecture-patterns/download>) 
- ### Clean Code Principles

 

SOLID principles, design patterns, DRY, KISS, and clean code fundamentals. Use when reviewing architecture, checking code quality, refactoring, or discussing design decisions. Triggers on "review architecture", "check code quality", "SOLID principles", "design patterns", or "clean code".

 [View skill](<https://delaparra-services.nl/skills/clean-code-principles>) [Download zip](<https://delaparra-services.nl/skills/clean-code-principles/download>) 
- ### Writing Plans

 

Use when you have a spec or requirements for a multi-step task, before touching code

 [View skill](<https://delaparra-services.nl/skills/writing-plans>) [Download zip](<https://delaparra-services.nl/skills/writing-plans/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/macro/skills.zip>)

 

## Manuals

 

- [Programming paradigms and design patterns](<https://delaparra-services.nl/manuals/programmeerstijlen-en-ontwerppatronen>) 
- [From idea to spec](<https://delaparra-services.nl/manuals/van-idee-naar-spec>)

 

## Related services

 

- [OpenSpec](<https://delaparra-services.nl/services#service-04>)

If you have an idea for a new feature, you can work it out here before contacting a developer. 
- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/macro)
