Hi Bob!
On Monday, October 21, 2013 11:18:23 PM UTC-4, bobl...@...
l.com wrote:
> Hi folks,
>
> I am finally covering some of the new C++ features in my C++ course.
> I am interested in getting input from the C++ community as to the
> priority of new features to cover.
First off, without knowing more about the context of your
course -- purpose, length, students' previous programming
experience, students' previous c++ experience -- it's hard
to give appropriate advice.
Also, it sounds like you're already well along in your course
and coming up to the c++11 section, so my answer is probably
too late.
But I would turn things around and just teach c++11 as c++,
and use various c++ features (including c++11 features) as
appropriate. The c++11 standard was ratified already a couple
of years ago, and largely complete drafts and compilers
supporting much of the new functionality were available
already a couple of years before that, so c++11 should hardly
be looked upon as some mysterious bleeding edge thing.
Quoting Stroustrup in his c++11 faq:
What do you think of C++11?
That's a (to me) amazingly frequent question. It may
be the most frequently asked question. Surprisingly,
C++11 feels like a new language: The pieces just fit
together better than they used to and I find a higher-
level style of programming more natural than before
and as efficient as ever.
(Of course, he's a partisan.)
Although they might be considered syntactic sugar, a lot of
c++11 features are there to make programming more convenient
on a routine, day-to-day basis. (I'm thinking of things
like auto, range-for, in-class initialization, uniform and
list initialization, etc.)
If we as a community continue to adopt cleaner, better c++11
idioms as opportunity permits, and encourage our colleagues
(and students) to do the same, the language in the field
will get -- well -- cleaner and better.
And what better place to start than in a c++ class.
So rather than teach students -- I won't call them bad,
but rather less-good -- pre-c++11 habits and then tack
on some c++11 features at the end of the course, why not
just teach c++11 best practices from day one?
I recognize that some will argue that a lot of real-world
c++ is pre-c++11, but a lot of real-world code is java,
and python, and c. So I say why not teach your student
the best, cleanest programming style and idioms, making
use of language features (whether c++11 or not) that
support that style and those idioms, even as we recognize
that students will come across, and sometimes need to work
with, other programming styles, dialects, and languages.
That's my perspective, at least, although it may not be
appropriate for the context and purpose of your specific
class.
> ...
> TIA
>
> Bob
Good luck.
K. Frank