Beautiful C++: Updating Legacy Code

Beautiful C++: Updating Legacy Code

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 5h 02m | 601 MB

If you maintain an old large codebase, there’s a good chance you don’t understand parts of it. This course will show you how to update code to a more readable, understandable, and maintainable state by taking full advantage of modern C++ techniques.

C++ has been a popular programming language for decades, which means there’s some really old code out there. Some of it is very hard to read and maintain. Capabilities have been added to the language and standard library that could simplify this code, and possibly make it faster or eliminate nagging intermittent bugs. In this course, Beautiful C++: Updating Legacy Code, you’ll learn how to approach a large and unfamiliar codebase and make changes to modernize code. First, you’ll learn some strategies for deciding exactly what to change. Then, you’ll be introduced to language features and library capabilities that may not have existed when your code was first written, and can make it better now. Finally, you’ll discover how to evaluate your progress and spread your gains through the rest of the code. By the end of this course, you’ll be prepared for your code to last another generation or two and take full advantage of what modern C++ has to offer.

Table of Contents

Course Overview
1 Course Overview

What Target Are You Trying to Reach
2 Introduction
3 Legacy Code
4 You Wish This Code Was Modern
5 You Wish This Code Was Maintainable
6 Why Would You Change Working Code
7 Course Approach
8 Begin with the End in Mind
9 Summary

The Big Picture
10 Introduction
11 What Not to Do First
12 What Parts Need Attention
13 Leaving a Breadcrumb
14 Tidy As You Go
15 Being Less Worried About Changes
16 Know the Risks
17 I Don t Have Time to Clean This Up
18 Let Tools Help You
19 Specific Changes to Make
20 Do We Need to Freeze
21 Do We Need to Change Our Ways
22 Summary

The Compiler Is Your Friend
23 Introduction
24 Compiling Really Old Code
25 Demo – String Warnings
26 Loop Scope
27 New Keywords
28 Turn up the Warning Level
29 Demo – Warning Level
30 You Might Find Bugs
31 The Preprocessor
32 Is This Macro Really a Function
33 Names for Numbers
34 Demo – Macros
35 Wrap Code in Housekeeping
36 Demo – Timing with Lambdas
37 Summary

Use C++ as C++
38 Introduction
39 What Makes C++ C++
40 While You re Looking at That Function
41 Spotting Classes
42 Demo – Creating Classes
43 Cleanup and Housekeeping Code
44 Demo – RAII
45 Make It Noncopyable
46 RAII Benefits
47 Similar Functions or Checks
48 Const Correctness
49 Don t Typedef Structs
50 Proper Casts
51 Summary

Language Changes in C++ 11 14 and 17
52 Introduction
53 Standards
54 Auto
55 Demo – Auto
56 Null
57 Demo – Null
58 Lambdas
59 Demo – Lambda
60 For Loops
61 Demo – For Loops
62 Enum
63 Constructors
64 Summary

The Standard Library Will Save You Time and Trouble
65 Introduction
66 String
67 Demo – String
68 Arrays
69 Vector
70 Demo – Vector
71 Action Plan
72 RAII Pointers
73 Standard Smart Pointers
74 Demo – Smart Pointers
75 Kinds of Pointers
76 Do You Need A Pointer
77 Algorithms
78 Write Output
79 Summary

Reorganizing for Transparency
80 Introduction
81 Ripping Things Apart
82 Arrow Code
83 Wall of Declarations
84 When You Declare Where You Use
85 Refactor into Smaller Functions
86 Function Parameters
87 Add More Const
88 Tidy Up
89 Error Codes
90 Summary

When Are You Done
91 Introduction
92 Evaluate Your Changes
93 Legacy Code
94 Did You Find a Bug
95 So What s Next
96 Think About Wrappers and Facades
97 Other Places for Wrappers
98 When Do You Rebuild It All
99 Summary