4 ms·
> Why would it be a joke? A certain influential segment of the C and C++ development community, the kind that tends to worship "best practices" and "consistenc
by quotemstr 10y ago
> Why would it be a joke?
A certain influential segment of the C and C++ development community, the kind that tends to worship "best practices" and "consistency", has been preaching for years that C preprocessor macros are evil, even in cases where they allow for much clearer code.
I'm not sure these people were born with the ability to experience joy.
- marcosdumay 10y agoThe biggest problem with C macros is that they are too opaque. The compilation stack will complain about code that is different from what you have, and leave you with little hint about what in your code is generating the broken code. It's also confusing when debugging. That said, yes they can lead to large gains so when they are worth it, go for them. Just mention in the documentation that they are macros, in big letters.
- magnetic 10y ago> Just mention in the documentation that they are macros, in big letters. The macros themselves are usually in BIG_LETTERS already... that generally gives it away.