5910 Breckenridge Pkwy Suite B, Tampa, FL. 33610
(800) 272-0707

SkillSoft Explore Course

IT Professional Curricula     Software Development Solution Area     C++ Programming     Defensive C++
Writing good, robust, and maintainable C++ code involves understanding the intricacies of the language and avoiding common pitfalls. Use this course to learn more about avoiding fatal coding errors, adopting defensive coding techniques, and following best practices and other code niceties
Examine some common coding errors, the correct way to set up constructors in code, and the pitfalls of overriding non-virtual functions. You will also explore object slicing errors, how to cast objects to other types, and the use of smart pointers to manage resources in C++. Finally, you will understand the implications of the static initialization order fiasco in C++ and how you can avoid it.
At the end of this course, you will have the knowledge and skills to write robust, defensive C++ code.

Objectives

Defensive C++: Writing Defensive C++ Code

  • discover the key concepts covered in this course
  • write C++ code incorporating defensive techniques
  • specify constructors that leave your object in a valid state
  • use the const keyword early and often to identify methods that don't update member variables
  • override virtual functions to take advantage of runtime polymorphism
  • identify situations where object slicing is likely to occur
  • use the right type of cast for your use case
  • use the right type of cast when you need additional checks
  • manage memory correctly even when exceptions occur in code
  • write code to avoid the static initialization order fiasco
  • use the right technique to access elements of a collection
  • summarize the key concepts covered in this course