Vitaly Fanaskov: More "monadic" operations for modern C++

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • Quite a few useful things were accepted for the upcoming C++ standard. The class std::optional supports more operations for processing the contained data depending on whether it has a value or not. The proposal for std::expected is finally in place. It's getting easier to write robust programs with this tooling!
    In this talk, I'm going to show how to use these and some other classes for creating programs in a more functional style. We will discuss immutability, functions without side effects, and how this changes the entire code style of your program. Additionally, I'll address one of the most frequently asked questions: "how do I write logs in the functional programming world?".
    You will learn how to write programs without explicit ifs, extract tiny reusable functions, and return values to indicate incorrect states instead of throwing exceptions.

КОМЕНТАРІ •