My Opinions
This section is a crude blog, where I consign my pearls of wisdom or pearls of folly. I trust the reader to discern between the two kinds.
Since the posts here don't support comments (and probably never will) you are encouraged to email me if you have something on your mind that you'd like me to know.
C++ Concepts
Posted: 2016-04-03. Updated: 2016-04-04.
If you do not yet know what C++ concepts
are about, I suggest reading the following articles:
- https://en.wikipedia.org/wiki/Concept_%28generic_programming%29
- https://en.wikipedia.org/wiki/Concepts_%28C%2B%2B%29
- http://bartoszmilewski.com/2010/06/24/c-concepts-a-postmortem/
My opinion on concepts
can be summed up simply: I think that they don't belong in C++.
They add yet one more layer of complexity on top of the already too many layers that make up C++. This will make the language harder to master still.
They will also coax programmers into the waste of time, no doubt intellectually satisfying, that will be defining one's own concepts
and concept maps
, definitions which will need to be strictly maintained otherwise they'll break the rest of the code.
In the end, the C++ concepts
are a meta-feature whose only purpose is to patch the true feature, the templates, which have turned out to be unfriendly to both computers and humans over the years.
A proper solution would be redesigning templates, breaking backwards compatibility if needed, and with inspiration from the D language add template constraints.
What we have instead is an improper solution which introduces a meta-feature that merely helps the C++ compiler print human-readable error messages and stop compilation sooner (maybe). Ironically, at the cost of maintainability and understandability.