4 ms·
”Templates are not that bad as a user” My take would be they are bad for both users and authors. In 2024 the expected compiler output for a syntax error in a
by fsloth 2y ago
”Templates are not that bad as a user”
My take would be they are bad for both users and authors.
In 2024 the expected compiler output for a syntax error in a statically typed language is a specific-as-possible report where in the written source the syntax fails - not 40 lines of illegible template error messages.
There are some cases where templates are the best design option. But they should be used only as the last resort when it’s obvious that’s the best way.
- pjmlp 2y agoIn 2024, I expect people implementing templates making use of concepts, and if not possible, at very least static_assert alongside enable_if. Naturally reality often times doesn't match expectations.