3 ms·
C replacements always seem to have noisier syntax, and not nearly enough motivation to switch from C. And if I could have been tempted with templates and a more
by veltas 4y ago
C replacements always seem to have noisier syntax, and not nearly enough motivation to switch from C. And if I could have been tempted with templates and a more intelligent type system I would have switched to a restricted C++ subset years ago.
And yes macros are dirty, but yet they're often far simpler than the alternatives, based on how languages like C++, Zig et al have attempted to reduce them.
- jstimpfle 4y agoThis. I love my macros, even if many of them end up being replaced by code, and some of them only patch up shortcomings in the language. There will always be shortcomings in any language, and there will always be situations that need to be fixed with a quick hack, even though that is not a long term solution. And in almost any project I have a few lines of macro magic that almost completely fixes situations where I would otherwise have to resort to terribly complicated C++ templates and slow compile times.