How C++23 Changes the Way We Write Code - Timur Doumler - CppCon 2022

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

How C++23 Changes the Way We Write Code - Timur Doumler - CppCon 2022

C++20 was a huge release: coroutines, concepts, ranges, and modules profoundly changed the way we write code and think about C++. In comparison, C++23 is a lot smaller in scope: its primary mission is to complete C++20, to fill holes, and to fix issues. Nevertheless, some great new features made the cut this time around, both in the standard library and in the core language. This is even more remarkable considering that the entire feature design phase of C++23 took place during the COVID-19 pandemic, challenging the ISO C++ committee to completely reinvent how we work together.

This is not a firehose talk about C++23 that tries to cram as many additions and improvements as possible into one hour. Instead, we deliberately focus on just a handful of new features that are going to noticeably change and improve the experience of the everyday C++ programmer. We will talk about how `std::expected` improves error handling, the huge impact that `std::mdspan` will have on scientific computing, how deducing `this` greatly simplifies longstanding C++ idioms such as CRTP, and how `std::print` will forever change how we write "Hello, World".
---

Timur Doumler

Timur Doumler is the Developer Advocate for C++ tools at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
---

#cppcon #programming #coding
Рекомендации по теме
Комментарии
Автор

16:49 at this point I imagined Timur removing these features one by one, and then finishing the talk and asking the audience if there are any questions 🙂

Maciej-Komosinski
Автор

amazing, finally i can stop explaining what "cout", "<<", and "endl" means or avoid the question to not explode student's brain when teaching how to program in c++.
also, mdspan is amazing, i loved it, really loved it.

marcusmors
Автор

2023: the year when somebody proudly presents a print function in C++

AntoshaPushkin
Автор

16:54 is where the removal of stuff from the list ends and C++23 feature explanations start.

roboterbasteln
Автор

Wow. The CRTP simplification is simply amazing.

isitanos
Автор

Wonderful. I've been programming C++ for over 25 years, and it's getting so complicated that even language experts struggle with concepts beyond C++17. Meanwhile, there still isn't standard library support for parsing UTF-8 strings, no standard network / GUI / actor library, no reflection, etc. I think the standards committee must pause adding esoteric features to the language for at least a decade or two, and look at what the industry is crying out for, and start focusing on libraries instead of extending language features. Some of the feature added during the last couple of decades have ended up being impractical (eg. futures), while ignoring better abstractions (like Actors). Perfect is the enemy of good enough ... However, I do understand the politics of committees, if you want to add you personal work/signature to the language/standard, your stand a greater chance of success by adding a minor language feature instead of adding a new library. Anyhow, good presentation Timur, we're lucky to have you as part of the community.

zenjasolaja
Автор

Please, @CppCon, add chapters to the talks.

Bolpat
Автор

Really cool talk. The one thing that was missing from std::expected was a quick mention of the monadic functions that come with it. In my experience, these make working with std::expected much easier than first thought, especially if you have/want to use it across a larger call stack and to compose multiple functions that return a std::expected.

sergecamille
Автор

Timur has greatly strengthened his speaking skills. Good job!

TheOnlyAndreySotnikov
Автор

Timur as always made a great and useful talk! Thank you, I love the way you make your presentations!

alexeysubbota
Автор

I really like all four highlighted additions.

Now would be good time to finally add some bool has_key() method to standard hash containers, so we don't have to write lookup + result comparison for such a basic operation.

Or, make it so that compiler error output doesn't always display all default template parameters, unless the code explicitly specifies non-default value. If the code works with std::string, compiler error could just say that (at least in some cases?), instead of std::basic_string<char, std::char_traits<char>, std::allocator<char>>.

vid
Автор

I hope one day we will get the same syntactic sugar as Rust with Result, where we use "?" to access the internal value or directly return the error.
It would avoid all the boiler plate code of checking the status when you don't want to do anything specific but propagate the error.

totof
Автор

Clicked on the video to see what's going with C++ these days....stayed for the comments LOL

voidsifr
Автор

Really cool talk as expected from Timur Doumler but I think there would have been time to talk through half of these features just in the time he took to widdle down the list.

lexer_
Автор

This talk is an excellent primer on why you should port your C++ projects to Java, C#, or Rust. Or even just pure C.

fnamelname
Автор

Reading this comments ... i think Cpp needs to be completely remade lol

heferh
Автор

A truly fascinating lecture, start to finish!

yoavmor
Автор

"How does it know at runtime which overload of the overload set to call?" is probably going to be my "I should stop worrying about this and just use it" moment.

Axacqk
Автор

Regarding std::expected, it will be possible to create a "std::expected coroutine" that uses the coroutine customization points to hide explicit error checking logic using the co_await keyword.

davidsicilia
Автор

At 1:00:00 this is what I needed in C++ for really long time. 👍

rajarshitiwari