News for hackers. Stuff that matters.
Re:My Favorite C++ Pattern: X Macros (2023) by lmm on Tuesday March 25, 2025 @09:37PM (#43477961)
> Now you have a additional stage in your build, a bunch of new code to maintain, and either a bespoke language embedded in your standard C++ or a bunch of code emitting C++ separately from the code it logically belongs with.

The preprocessor is already a bespoke language embedded in your C++, and code written in it is generally harder to maintain than, like, Python.

The cost of doing something non-standard is real, but not infinite; at some point the benefit in code maintainability and sanity is worth it.

Re:My Favorite C++ Pattern: X Macros (2023) by wat10000 on Tuesday March 25, 2025 @10:00PM (#43478084)
The preprocessor is part of C++.

I agree that you can go too far with it and it becomes better to do it a different way, but the X-macros technique is straightforward and easy to understand.