Back to Basics: Functional Programming and Monads in C++ - Jonathan Müller - CppCon 2024

preview_player
Показать описание
---

Back to Basics: Functional Programming and Monads in C++ - Jonathan Müller - CppCon 2024
---

Functional programming is a declarative way of writing programs by composing functions.
In many situations, this can lead to code that is easier to write and understand and less error-prone.
However, it requires a shift to a more functional mindset.
This talk gives an introduction to functional programming in C++ using the modern standard library.
We will cover algorithms using `std::ranges`, composable error handling with `std::optional` and `std::expected`, algebraic data types, and separating IO from computation.
In the end, we'll even cover the M-word.
---

---

Jonathan Müller

Jonathan is a Software Engineer at think-cell. There, he is responsible for maintaining think-cell's core libraries, which include a custom range library, a fast and convenient JSON parser, and many other utilities and data structures to write elegant C++ code. Before working at think-cell, he wrote many useful open-source C++ libraries. He is also a member of the C++ standardization committee, where he serves as the assistant chair for std::ranges, and a frequent conference speaker.
---

CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
---

---

#functionalprogramming #monad #cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #technology #programming #programmer
Рекомендации по теме
Комментарии
Автор

This is an excellent talk, so we featured it in the latest issue of 💥Tech Talks Weekly. Congrats!

TechTalksWeekly
Автор

using std::error_code as unexpected type of std::expected provides quite a convenient way to mix different errors. However, it requires to "normalize" all errors to become a std::error_code...

LeonFreist
Автор

39:45 I didn't get what are the underscores _ in the template parameter

AlfredoCorrea
Автор

We just migrated our project to C++20 and this talk makes me want to move our project to C++23. Nice eye opening talk!

anandyutube
Автор

Fantastic talk, thank you!

Unfortunately the example with the Fibonacci generator doesn't seem to work (at least with the latest gcc), std::ranges::find_if returns std::ranges::dangling.

fzort
Автор

Question for 13:45 -> transform with fib function would need a state, otherwise we get quadratic time, isnt'it ?
So, not really pure functional.
More precisely, fib may use a closed formula with some power, but in general having states still helps (of course).

maurorusso
Автор

नेहमी प्रमाणे चालगी माहिती दिली. बर्याचशा शंका दूर झाल्या.

sanjaygatne
join shbcf.ru