OOPortal OOPortal
Programming C++  «Prev  Next»
Lesson 3 Explore Key Course Features
Objective This course takes an evolutionary approach to learning C++.

Explore Key Course Features in C++

A C programmer will be able to immediately write simple programs in C++ and quickly gain the skills to write more complex functions and programs.
Rather than introducing object-oriented programming, we instead focus on the similarities and differences between C and C++, emphasizing C++'s improvements over C. By starting from the C perspective and moving to the C++ view of familiar concepts such as
  1. input/output,
  2. comments,
  3. casts,
  4. functions,
  5. structures,
  6. pointers,
  7. and arrays,
you will find the transition to C++ efficient and fun.
Object-oriented programming in C++ is covered in detail in the next two courses in the C++ for C Programmer series. If you would like an overview of object-oriented programming, click the Help button in the toolbar. This material is supplementary and is not necessary to complete Introduction to C++.

Exercises

This course is programming-intensive. Many of the exercises require you to write, compile, and test C++ programs.
These tutorials explain the C++ language from its basics up to the newest features of ANSI-C++, including basic concepts such as arrays or classes and advanced concepts such as polymorphism or templates. The tutorial is oriented in a practical way, with working example programs in all sections.


C++11 and C++14

If you are an experienced C++ programmer and are anything like me, you initially approached C++11 thinking, It is C++, only more of the same. But as you learned more, you were surprised by the scope of the changes. auto declarations, range-based for loops, lambda expressions, and rvalue references change the face of C++, to say nothing of the new concurrency features. And then there are the idiomatic changes. 0 and typedefs are out, nullptr and alias declarations are in. Enums should now be scoped. Smart pointers are now preferable to built-in ones. Moving objects is normally better than copying them. There is a lot to learn about C++11, not to mention C++14.
More importantly, there is a lot to learn about making effective use of the new capabilities. If you need basic information about modern C++ features, resources abound, but if you are looking for guidance on how to employ the features to create software that is correct, efficient, maintainable, and portable, the search is more challenging. That is where this course comes in and it is devoted not to describing the features of C++11 and C++14, but instead to their effective application.

The information in the book is broken into guidelines called Items. Want to understand the various forms of type deduction? Or know when (and when not) to use auto declarations?
Are you interested in
  1. why const member functions should be thread safe,
  2. how to implement the Pimpl Idiom using std::unique_ptr,
  3. why you should avoid default capture modes in lambda expressions, or
  4. the differences between std::atomic and volatile?
Furthermore, they are platform-independent, Standards-conformant answers. This course is about portable C++.
The Items in this course are guidelines, not rules, because guidelines have exceptions. The most important part of each Item is not the advice it offers, but the rationale behind the advice. Once you have read that, you will be in a position to determine whether the circumstances of your project justify a violation of the Item's guidance. The true goal of this course is not to tell you what to do or what to avoid doing, but to convey a deeper understanding of how things work in C++11 and C++14.