3 ms·
My issue with macros is that how they are used can vary greatly because it is so flexible. I’ve worked in a codebase where we treated macros like someone might
by fsociety 5y ago
My issue with macros is that how they are used can vary greatly because it is so flexible. I’ve worked in a codebase where we treated macros like someone might treat C++ templates and it was great.
For example, I think x-macros can be super useful and a consistent way to define certain data structures.
But using macros to define your own special DSL and make C code not look like C code is pretty nasty.
- Hirrolot 5y agoI don't think the suggested metaprograms in the blog post don't look like C, in opposite [1]. [1]: https://hirrolot.github.io/posts/extend-your-language-dont-alter-it.html https://hirrolot.github.io/posts/extend-your-language-dont-a...