Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Template metaprogramming can be abused, too. Expression templates come to mind. You can do expression templates in D, but I have discouraged it and it has not caught on to my relief.

But templates still are a better choice than macros.



I would have thought so but fast forward to today and we have template abuse that cause very long build times and creates gigabytes of symbols that flood memory and crash compilers and take debuggers to their knees and create the most inscrutable code to read and debug that MACRO jockeys could never have dreamed of.

I'm working on a C++ project where maintainers have had to resort to changing namespaces to single letters as a grotesque stop gap against the symbol table explosion!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: