Re:My Most Important C++ Aha Moments (2006)
by kazinator on Monday June 27, 2016 @03:44PM
(#11988896)
> that it was a shame to require secret knowledge and aha moments to use
But Myers had this aha moment about private constructors in 1988! Since then, this has been covered in countless books, tutorials and coding convention documents.
A newbie still has to read something in order to learn about "= delete". This is not "discoverable" just by experimenting with the language!
Knowing that delete is a keyword, and that there are declarations of the form "specifiers fun-declarator = blurb" you are very unlikely to discover, on your own, that the blurb may be the keyword "delete", and that this actually compiles and has a certain useful effect.
However, the combination of constructors and "private:" is discoverable, as Myers' 1988 aha moment shows. It's a logical combination of independent features.
It's okay for techniques in languages to be discoverable logical combinations of features rather than arbitrary syntax thrown in.
It's also okay for the culture which surrounds a language to have a body of techniques which are carried in that culture, rather than shoehorned into the language parser.
But Myers had this aha moment about private constructors in 1988! Since then, this has been covered in countless books, tutorials and coding convention documents.
A newbie still has to read something in order to learn about "= delete". This is not "discoverable" just by experimenting with the language!
Knowing that delete is a keyword, and that there are declarations of the form "specifiers fun-declarator = blurb" you are very unlikely to discover, on your own, that the blurb may be the keyword "delete", and that this actually compiles and has a certain useful effect.
However, the combination of constructors and "private:" is discoverable, as Myers' 1988 aha moment shows. It's a logical combination of independent features.
It's okay for techniques in languages to be discoverable logical combinations of features rather than arbitrary syntax thrown in.
It's also okay for the culture which surrounds a language to have a body of techniques which are carried in that culture, rather than shoehorned into the language parser.