Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

How I Learned to Stop Worrying and Love the C++ Type System

CppNow via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the power of C++'s type system in this conference talk from C++Now 2019. Learn how to leverage strong typing to create safer, more expressive code. Discover the pitfalls of using primitive types for domain values and understand the benefits of implementing custom wrapper types. Examine historical perspectives on type systems, from early programming languages to modern C++. Delve into topics such as integral promotion, numeric conversions, and the challenges posed by C++'s legacy. Gain insights into implementing and teaching simple wrapper types, and explore a work-in-progress framework for mixing in operators safely. Understand how proper domain types can enhance code clarity and prevent common errors, using examples from the standard library and real-world scenarios. Apply the Whole Value Pattern to improve function interfaces and reduce bugs caused by parameter confusion.

Syllabus

Intro
What are types
Historical languages
First programming experience
Second programming experience
Pascal
what is a type system
whats a type system
type system
strong
explicit vs implicit
What can go wrong
Benefits of the Type System
The Lack of Types
Integral Promotion
Strong Type System
Member Functions
enums
library fails
the whole value pattern
Dont use primitive types

Taught by

CppNow

Reviews

Start your review of How I Learned to Stop Worrying and Love the C++ Type System

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.