Exceptional C++@ciura_victor Victor Ciura Principal Engineer CppCon 2021 October 25th Exceptional C++2021 Victor Ciura | @ciura_victor - Exceptional C++ X Abstract When writing code we usually focus our attention Victor Ciura | @ciura_victor - Exceptional C++ 3 About me Advanced Installer Clang Power Tools @ciura_victor2021 Victor Ciura | @ciura_victor - Exceptional C++ 4 Online presentation Q & A Use the Q&A tab in Zoom2021 Victor Ciura | @ciura_victor - Exceptional C++ 5 Exceptional C++ When writing code we usually focus our attention on the happy paths - that’s where the interesting0 码力 | 113 页 | 24.39 MB | 6 月前3
Exceptionally Bad: The Story on the Misuse of Exceptions and How to Do Bettercharacteristic of Exceptions 9 Bloomberg ForewordWhat were Exceptions meant to give us ? 10 Bloomberg Exceptional IdealsWhat do Exceptions now give us ? • Easy to read the happy path • Lack of clutter in code “recommended” way of error handling in the language • Endorsed by stdlib 11 Bloomberg Exceptional Ideals12 Bloomberg Exceptional Ideals enum MyStatus { good, not_good, bad}; MyStatus applyX(MyClass& out); std::cout << "error : " << rc << std::endl; … } } Clutter Function signature13 Bloomberg Exceptional Ideals enum MyStatus { good, not_good, bad}; // Throws MyStatus on error void apply(MyClass&0 码力 | 85 页 | 2.32 MB | 6 月前3
The Roles of Symmetry And Orthogonality In Design2021 Levels of “Knowing” • Examples: • System-specific adapters may require custom handling • Exceptional events may require special processing • Custom or adaptive behavior may invoke novel execution 2021 Levels of “Knowing” • Examples: • System-specific adapters may require custom handling • Exceptional events may require special processing • Custom or adaptive behavior may invoke novel execution 2021 Levels of “Knowing” • Examples: • System-specific adapters may require custom handling • Exceptional events may require special processing • Custom or adaptive behavior may invoke novel execution0 码力 | 151 页 | 3.20 MB | 6 月前3
A Security Guide for Kotlin DevelopersThrough Their Lifetimes • Not Adhering to Coding Standards • Improper Checking or Handling of Exceptional Conditions • Failure of Protection Mechanisms • Inherent Weaknesses in the Programming Language busy coding their app, it might be strayed to the peripherals. Improper checking or handling of exceptional situations, however, can lead to unpredictable app behavior. The worst case is you miss an exceptionally data in an effort to intentionally crash the app, exploit security vulnerabilities, or induce exceptional states during testing is the best way to prevent these types of attacks. Manually testing for0 码力 | 13 页 | 1.80 MB | 1 年前3
Quantifying Accidental Complexity: An empirical look at teaching and using C++C++ 202x Stroustrup & Sutter, eds.: C++ Core Guidelines Sutter: Exceptional C++ Sutter: More Exceptional C++ Sutter: Exceptional C++ Style 8 533 language 84 std:: library 11 general/local 10 wrong0 码力 | 36 页 | 2.68 MB | 6 月前3
Back to Basics: Exceptions(And When Not) 31 Use exceptions … … for errors that are expected to occur rarely … for “exceptional cases” that cannot be dealt with locally (I/O errors) File not found Can’t find key in map (And When Not) 33 Use exceptions … … for errors that are expected to occur rarely … for “exceptional cases” that cannot be dealt with locally (I/O errors) File not found Can’t find key in map (And When Not) 36 Use exceptions … … for errors that are expected to occur rarely … for “exceptional cases” that cannot be dealt with locally (I/O errors) File not found Can’t find key in map0 码力 | 111 页 | 4.87 MB | 6 月前3
Better Code: Contractsmeaningless advice abounds: • Don't use exceptions for control flow • Only use exceptions for exceptional / unexpected conditions 82© 2023 Adobe. All Rights Reserved. A short rant about (our misunderstanding meaningless advice abounds: • Don't use exceptions for control flow • Only use exceptions for exceptional / unexpected conditions The key to power with exceptions is focusing on contracts and invariants meaningless advice abounds: • Don't use exceptions for control flow • Only use exceptions for exceptional / unexpected conditions The key to power with exceptions is focusing on contracts and invariants0 码力 | 204 页 | 4.46 MB | 6 月前3
failing successfullythrowing an exception 21 Exceptions Common to say that exceptions are for “exceptional” situations Deeming something “exceptional” makes a decision on behalf of user Exceptions simplify… ...error reporting:0 码力 | 44 页 | 625.44 KB | 6 月前3
Conan 2.1 DocumentationConfigurations like tools.build:cxxflags can be used to inject arbitrary C++ compile flags. In some exceptional cases, it might be desired to inject CMake variables directly into dependencies doing CMake builds possible to use 2 versions of the same compiler to build the current package. However there are some exceptional situations when something like that is desired. Let’s recreate the potential scenario. Please, Will generate a “conflict”, showing an error like Duplicated requirement. However there are some exceptional situations that we could need to depend on the same tool_requires version, but using different0 码力 | 694 页 | 4.13 MB | 1 年前3
Conan 2.10 DocumentationConfigurations like tools.build:cxxflags can be used to inject arbitrary C++ compile flags. In some exceptional cases, it might be desired to inject CMake variables directly into dependencies doing CMake builds possible to use 2 versions of the same compiler to build the current package. However there are some exceptional situations when something like that is desired. Let’s recreate the potential scenario. Please, Will generate a “conflict”, showing an error like Duplicated requirement. However there are some exceptional situations that we could need to depend on the same tool_requires version, but using different0 码力 | 803 页 | 5.02 MB | 10 月前3
共 321 条
- 1
- 2
- 3
- 4
- 5
- 6
- 33













