CppCon 2018: Brand & Nash “What Could Possibly Go Wrong?: A Tale of Expectations and Exceptions”

preview_player
Показать описание
--
Simon Brand & Phil Nash “What Could Possibly Go Wrong?: A Tale of Expectations and Exceptions”


In software things can go wrong. Sometimes we might expect them to go wrong. Sometimes it’s a surprise. In most cases we want to build in some way of handling these disappointments.

In some cases we can use exceptions. But there are many cases where the overhead of exceptions is more than we want or can afford - and some are so constrained that exceptions are not even possible. Alternatives now include std::optional, or the proposed std::expected - but these come with a lot of code overhead

What we really want is a way to concisely produce and handle disappointments in our code in a performant manner. This talk will evaluate a few approaches to solving this, including monads, syntactic sugar for error handling, and we'll even look at an intriguing possibility that promises to unify these worlds.

Simon Brand, Microsoft
C++ Developer Advocate

Simon is a C++ Developer Advocate at Microsoft. He turns into a metaprogramming fiend every full moon, when he can be found bringing compilers to their knees with template errors and debating undefined behaviour online. He co-organises the Edinburgh C++ user group and contributes to various programming standards bodies.

Outside of programming, he enjoys experimental films, homebrewing, and board games.

Phil Nash, JetBrains
Developer Advocate

Phil is the author of the test frameworks, Catch - for C++ and Objective-C, and Swordfish for Swift. As Developer Advocate at JetBrains he's involved with CLion, AppCode and ReSharper C++. More generally he's an advocate for good testing practices, TDD and using the type system and functional techniques to reduce complexity and increase correctness. He's previously worked in Finance and Mobile as well as an independent consultant and coach specialising in TDD on iOS.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

How does map get a high reasonability score? To someone who has never seen this stuff it's very unusual code. And even worse if you are only used to basic control flow and none of the new fangled inline functions. I'd also dock two points for performance just because it's a big mess for the optimizer to clean up.

henke
Автор

So is anybody working on a prototype implementation for one of the big compilers?

Trassr
Автор

Why does try catch clause have better message score? I certainly can throw exceptions in happy path, and people will get wrong message.

echosystemd
Автор

need this in cpp20. make it happen pls kthx

KarelDonk
Автор

I think "join" function at 36' takes unnecessary parameter "fun"

bronekkozicki
Автор

I really wish presenters would stop using proportional fonts in presentations like these, especially when presenting in part about the readability of their code

samflores
Автор

The presentation style is of low information bandwidth.

mcneeleypeter
Автор

Looks like someone discovered the Either monad.

guillaumevermeillesanchezm
Автор

No, no 'try' on the call - this kills chaining. Also, we are writing for the good path, constantly injecting code for the bad path is noisy and distracting.

YourCRTube