In the earlier chapters, we learned about loops. As we know, they can help us do repetitive tasks in a faster and more efficient way. But macros go a step further. They help to do the following:
- Reuse code
- Specify a value in one instance but use the value in multiple instances
- Perform mathematical and logical operations and let the macro consume this information by itself
So should you always write macros? No, writing macros can get challenging. The more you want the macro to do, the more complex the coding process can get.
The following topics will be covered in this chapter:
- Introduction to macros and macro definitions
- Macro variable processing
- Macro resolution tracking
- Comparing positional and keyword parameters
- Data-driven programming
- Writing efficient macros