37 ms·
This is why I've always hated C++. Taking something like templates, and abusing the turing-completeness of it. If I wanted macros I would use a language that
by bcrosby95 6y ago
This is why I've always hated C++. Taking something like templates, and abusing the turing-completeness of it. If I wanted macros I would use a language that actually supports them so I wouldn't have to resort to byzantine hacks. Stuff like this is why lots of people would rather use C over C++.
- AnimalMuppet 6y agoDoesn't C++ exactly support C macros? In what way is using C macros "better" than using the exact same macros in C++?
- teleforce 6y agoD language is probably the Goldilocks of programming languages for the rest of us in terms of compilation speed (comparable to Go), program execution (comparable to C/C++) and ease of programming and debugging (comparable to Python). The author of the D language despises macro more than you, and has designed a solution for modern and sane approaches to template programming [1][2]. If you want to program like C in D modern eco system there is a safer betterC. Heck now there is even borrow checking capability if you want safety guarantees similar to Rust. [1]https://mobile.twitter.com/WalterBright/status/1343128003178541056 https://mobile.twitter.com/WalterBright/status/1343128003178... [2]https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ https://dlang.org/blog/2018/03/29/std-variant-is-everything-...