News for hackers. Stuff that matters.
Re:Esoteric C++ Contest 2018 by mianos on Saturday March 23, 2019 @05:18PM (#19472408)
Compilation times? Obfuscation? Bloat? I like them but these are valid negatives.
Re:Esoteric C++ Contest 2018 by llukas on Saturday March 23, 2019 @09:50PM (#19473608)
Those are problem only if templates are misused (imho).
Re:Esoteric C++ Contest 2018 by Something1234 on Saturday March 23, 2019 @10:27PM (#19473783)
Which is pretty much anything outside of the STL library's basic usage.
Re:Esoteric C++ Contest 2018 by mianos on Saturday March 23, 2019 @11:37PM (#19474108)
Yes I agree. I would not have been so down-voted so much if I had said the use of templates in the std:: libraries and some others, not all, is fantastic. But, the use of templates to make generic code when it does not need to be leads to the same functionality as specialised classes with longer compile times and obfuscation.
Re:Esoteric C++ Contest 2018 by llukas on Sunday March 24, 2019 @03:47AM (#19475027)
I agree that putting templates where they not belong causes problems (even more than just longer compile times and obfuscation).

However, properly designed templates with enough attention put into exposing functionality beat non-templated approaches right off the bat.

Example: http://eigen.tuxfamily.org/dox/TopicInsideEigenExample.html