2 ms·
X-macros in C [1] are great for doing compile-time code generation from tabular data. Especially for things like pinouts and their respective capabilities on mi
by snovv_crash 4y ago
X-macros in C [1] are great for doing compile-time code generation from tabular data. Especially for things like pinouts and their respective capabilities on microcontrollers, I haven't seen any other language give such a succinct, easily maintainable way of interacting and representing data such that it can be used for full function generation that an IDE can autocomplete names, types etc.
Sure there are other "newer" ways but they invariably involve so much boilerplate that you might as well just write all the code by hand.
1. https://en.wikipedia.org/wiki/X_Macro https://en.wikipedia.org/wiki/X_Macro