Victor Bazarov posted:
Besides, it could be a homework not given by a teacher; it looks
very much like an interview question from one of those "get ready
to be a C++ programmer by answering all those interview questions"
sites.
Maybe I'm narrow-minded, but here's an analogy that crept into my head:
Imagine I have a 4 year old son. He comes home from school one day and
asks me, "Daddy, what letter comes after G in the alphabet? Our teacher
told us to go find out.". Do I:
(a) Deem the teacher to be great for making the children go out and
learn things for themselves.
or:
(b) Scorn the teacher for not teaching my son the alphabet.
A teacher's job is to teach, not to instruct the student to go off and
figure things out for themselves. When I was at school, I had many
incompetant teachers (one of the perks of growing up in a working-class
area -- although I could never quite understand why they call it working-
class if the people don't actually work...) who regularly didn't teach, and
instead instructed the students to go off and learn things for themselves.
Result? Well it seems a little inconsistent that after 6 years of high
school, I'm fluent in one of the human languages I learned, and can't
string a sentence together in the other.
Don't tell a student, "Go off an figure out how we implement internal
linkage in C++". At the VERY least, instruct them to Google for "anonymous
namespace".