C++ guys hate static_if?
Sergei Nosov
sergei.nosov at gmail.com
Thu Mar 14 09:37:10 PDT 2013
From
http://herbsutter.com/2013/03/14/words-of-wisdom-bjarne-stroustrup/?utm_source=tf&utm_medium=t
Bjarne Stroustrup wrote the following a few minutes ago on the
concepts mailing list:
"Let me take this opportunity to remind people that
* "being able to do something is not sufficient reason for doing
it" and
* "being able to do every trick is not a feature but a bug"
For the latter, remember Dijkstra’s famous "Goto considered
harmful" paper. The point was not that the "new features" (loop
constructs) could do every goto trick better/simpler, but that
some of those tricks should be avoided to simplify good
programming.
Concepts and concepts lite are meant to make good generic
programming simpler. They are not meant to be a drop-in
substitute for every metaprogramming and macroprogramming trick.
If you are an expert, and if in your expert opinion you and your
users really need those tricks, you can still use them, but we
need to make many (most) uses of templates easier to get right,
so that they can become more mainstream. That where concepts and
concept lite fits in.
Some of you may find this hard to believe, but "back then" there
was quite serious opposition to function declarations because
"they restricted the way functions could be used and the way
separate compilation could be used" and also serious opposition
to virtual functions "because pointers to functions are so much
more flexible." I see concepts lite (and concepts) in the same
light as goto/for,
unchecked-function-arguments/function-declarations,
pointers-to-functions/abstract-classes."
More information about the Digitalmars-d
mailing list