News for hackers. Stuff that matters.
Re:Macros on Steroids: How pure C can benefit from metaprogr... by fsociety on Friday July 23, 2021 @02:07AM (#27927723)
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.

Re:Macros on Steroids: How pure C can benefit from metaprogr... by Hirrolot on Friday July 23, 2021 @02:50AM (#27927925)
I 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-a...