Defensive C++: Writing Defensive C++ Code

C++    |    Intermediate
  • 12 videos | 1h 34m 33s
  • Includes Assessment
  • Earns a Badge
Rating 4.4 of 31 users Rating 4.4 of 31 users (31)
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.

WHAT YOU WILL LEARN

  • 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

IN THIS COURSE

  • 1m 42s
  • 7m 6s
  • Locked
    3.  Specifying Valid Constructors
    11m 4s
  • Locked
    4.  Using the const Keyword
    8m 41s
  • Locked
    5.  Overriding Virtual Functions
    9m 34s
  • Locked
    6.  Understanding Object Slicing
    10m 31s
  • Locked
    7.  Using C-style Casts vs. static_cast<>
    10m 26s
  • Locked
    8.  Using dynamic_cast<>
    3m 30s
  • Locked
    9.  Managing Memory in the Presence of Exceptions
    11m 57s
  • Locked
    10.  Fixing the Static Initialization Order Fiasco
    12m 6s
  • Locked
    11.  Using the at() Method vs. the operator[]
    6m 14s
  • Locked
    12.  Course Summary
    1m 43s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 5.0 of 1 users Rating 5.0 of 1 users (1)
Journey C++
Rating 4.6 of 11 users Rating 4.6 of 11 users (11)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.4 of 153 users Rating 4.4 of 153 users (153)
Rating 4.6 of 60 users Rating 4.6 of 60 users (60)
Rating 5.0 of 5 users Rating 5.0 of 5 users (5)