Defying Complexity in C++ and The Magic of Coroutines

Main Speaker

Learning Tracks

Course ID

42784

Date

02/12/2025

Time

Daily seminar
9:00-16:30

Location

John Bryce ECO Tower, Homa Umigdal 29 Tel-Aviv

Overview

This seminar has two modules. In both, we will explore the nature of complexity in C++ and demonstrate tools to manage it effectively. The first module presents best design practices for building maintainable, scalable, and robust software. The second module presents the magic of coroutines that were introduced in C++ 20. This elegant compiler feature allows us to handle asynchronous programming and other complex scenarios in a succinct and idiomatic C++ way.

Who Should Attend

  • Experienced C++ programmers.
  • Software architects and technical leads.

Prerequisites

A good understanding of:
  • Object-Oriented Design principles
  • The C/C++ build process.
  • Templates, RAII and lambda expressions

Course Contents

  • Module 1: Building Solid Software in C++
    • The principles you need to know (and those you should forget)
      • Review the most essential design principles.
      • Take a critical look at the three pillars of OOD: encapsulation, inheritance, and polymorphism – do we really need them?
      • Examine code examples demonstrating common pitfalls and practical fixes.
    • Decoupling Across the Development Lifecycle
      • Explore techniques for decoupling in design, compilation, linking, and runtime.
      • Discuss practical methods: programming by interface, header organization, the pimpl idiom, and interfaces.
      • Examine shared objects, dynamic linking, dynamic loading, and plugins for runtime flexibility.
 
  • Module 2: The Magic of Coroutines
    • Part 1: Motivation for coroutines
      • Present five programming patterns that easily become complex: generators, asynchronous tasks, asynchronous tasks using an event loop, parsers, and the reactor pattern.
      • Explain how these patterns typically require complex state machines and nested callbacks.
      • Define coroutines and show how this simple compiler feature can simplify all these patterns.
    • Part 2: The mechanics of coroutines in C++
      • Introduce C++20’s simple, efficient, but powerful implementation of coroutines.
      • Explain the coroutine object and the awaitable pattern.
      • Present the keywords: co_await, co_return, and co_yield.
      • Demonstrate the coroutine flow.
    • Part 3: How coroutines reduce complexity
      • Implement all of the complex patterns using coroutines.
      • Compare the traditional implementation with the coroutine implementation.
      • Provide practical tips for coroutines, including the use of existing libraries where appropriate.
 

The conference starts in

Days
Hours
Minutes
Seconds