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.
[ Parent
| on HN ]
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.
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.
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