People should use more typedef to make C/C++ look sane, but there is some pushback that it hinders readability, but I feel that it is the opposite.
People should use more typedef to make C/C++ look sane, but there is some pushback that it hinders readability, but I feel that it is the opposite.
Templates are not that bad as a user, but as a template author, they're a completely different programming language that makes it much harder to express even simple ideas. (Concepts may have changed that, but I haven't had a chance to use them.)
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.
Naturally reality often times doesn't match expectations.
https://www.amazon.com/Move-Semantics-Complete-Guide-First/d...
Consistent naming conventions help a lot, but then that just introduces assumptions that could be wrong.
As with most points of code style, it comes down to taste.