Skip to content
HomeVideos
AllLongsCategoriesPlaylists
BooksBlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    CppCon 2015: Andrei Alexandrescu “Declarative Control Flow"

    CppCon

    2 HN recommenders · recommended in 5 months, 2016–2022

    YouTube

    1:07:35 · 102K views · Oct 18, 2015

    Andrei Alexandrescu's CppCon 2015 talk on handling exceptional control flow declaratively in C++. It uses scope guards with success and failure variants, built on std::uncaught_exceptions, to replace ad hoc RAII classes and rethrowing try/catch blocks.

    Pointed to in threads on defer, scope_exit and RAII as the clearest treatment of scope guards.

    Software Engineering & LanguagesC, C++, Rust, Go & systems languages
    1. 1:33:12
      De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable - Herb Sutter CppCon 2019CppCon90K views • 7 years ago
    2. 1:12:27
      CppCon 2015: Andrei Alexandrescu “std::allocator...”CppCon196K views • 11 years ago
    3. 1:39:25
      CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”CppCon149K views • 10 years ago
    4. 1:29:06
      CppCon 2015: Herb Sutter "Writing Good C++14... By Default"CppCon193K views • 11 years ago
    5. 1:24:36
      C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024CppCon23K views • 1 year ago
    6. 57:39
      CppCon 2016: Chandler Carruth “Garbage In, Garbage Out: Arguing about Undefined Behavior..."CppCon94K views • 10 years ago
    7. 1:54:00
      Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022CppCon277K views • 3 years ago
    8. 52:01
      CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”CppCon158K views • 9 years ago
    9. 1:15:46
      CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”CppCon178K views • 9 years ago
    10. 1:40:46
      CppCon 2015: Bjarne Stroustrup “Writing Good C++14”CppCon351K views • 11 years ago
    11. 1:29:55
      Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019CppCon184K views • 7 years ago
    12. 1:31:14
      CppCon 2017: Titus Winters “C++ as a "Live at Head" Language”CppCon53K views • 9 years ago
    13. 59:53
      CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”CppCon147K views • 7 years ago
    14. 1:40:27
      CppCon 2014: Herb Sutter "Back to the Basics! Essentials of Modern C++ Style"CppCon323K views • 12 years ago
    15. 1:04:00
      CppCon 2015: Sean Parent "Better Code: Data Structures"CppCon106K views • 11 years ago
    16. 1:00:21
      CppCon 2019: Matt Godbolt “Compiler Explorer: Behind The Scenes”CppCon29K views • 7 years ago
    17. 1:29:49
      Going Native 2012 Keynote Stroustrupsavage30933K views • 14 years ago
    18. 1:14:22
      CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?”CppCon289K views • 9 years ago
    19. 1:17:12
      C++ Seasoningaghuttun58K views • 13 years ago
    20. 1:47:45
      CppCon 2017: Herb Sutter “Meta: Thoughts on generative C++”CppCon105K views • 9 years ago

    5 comments from Hacker News

    1. @Ace17Jul 2016· in “Memory management in C programs (2014)”

      Google is an example that writing production code that doesn't use exceptions is possible, not that this is the right thing to do. They said that their decision was primarily legacy-motivated (in short, they were fearing that introducing exceptions in a non-RAII codebase would lead us to a long period of instability). I'll add that in some situations (e.g when freeing resources) the control flow gets very convoluted, and you don't want to deal with directly. See: Andrei Alexandrescu - Declarative Control Flow ( this video )

      RecommendsView on HN
    2. @uepFeb 2018· in “Scope exit in C++11 (2012)”

      Andrei Alexandrescu has a fun talk about implementing scope_exit using a new C++17 function: std::uncaught_exceptions (which is a tweak to std::uncaught_exception). Fundamentally, it doesn't really solve the destructor throwing exceptions issue though. this video

      RecommendsView on HN
    3. @einpoklumOct 2022· in “A Tour of C++ (Third edition)”

      A count of the number of exceptions in-flight was added, replacing the boolean indication of whether an exception is in-flight. This allows the scope guard construct proposed by Andrei Alexandrescu to distinguish between a scope being left on success and on an exception being thrown. YouTube video about scope guard: this video Description of the change to the standard: [LINK]

      CitesView on HN
    4. @dnauticsDec 2020· in “A Defer Mechanism for C”

      yes, you always run defer. I don't see it in this proposal, but Most languages/frameworks that implement a defer also implement a "error defer" which only gets triggered on some sort of labeled early exit scenario, and some implement "success defer": (i believe this is scopeguard: this video )

      CitesView on HN
    5. @watmoughJun 2022· in “Ask HN: What should have been the term for RAII?”

      I think scope or similar is good. Also, see related video here CppCon 2015: Andrei Alexandrescu “Declarative Control Flow" this video

      CitesView on HN