Better Code: Contracts1Better Code: Contracts Dave Abrahams & Sean Parent What's holding our software together? Can we do better than duct tape and good intentions? 2© 2023 Adobe. All Rights Reserved. Adobe’s Software acknowleged but the paper here presents the proof method much more in the spirit of program proofs than Milner's more algebraic view. An important step in proving the correctness of representations with is expected that membership of some of the members of the set will be tested much more frequently than others. The existence of such a concrete side-effect is wholly invisible to the abstract program0 码力 | 204 页 | 4.46 MB | 6 月前3
Better Code: Exploring ValidityBetter Code Exploring Validity David Sankel | Principal Scientist CppCon 2023© 2023 Adobe. All Rights Reserved. Adobe’s Software Technology Lab Sean Parent Senior Principal Scientist Manager, Software ”© 2023 Adobe. All Rights Reserved. C++ at Adobe! Careers Events Training Videos (STLab Better Code Series!) Blog Posts … developer.adobe.com/cpp© 2023 Adobe. All Rights Reserved. Comments/Questions©0 码力 | 117 页 | 6.03 MB | 6 月前3
Newer Isn't Always Betterw w w . a t o m o s s p a c e . c o m Newer Isn’t Always Better Investigating Legacy Design Trends and Their Modern Replacements Katherine Rochaatomosspace.com | 3 • Software Engineer at Atomos Space Explicit Access • Non-Intuitive Shared Access • Easy Transition to Individual Objects • Less Powerful than the Singleton? atomosspace.com | 27 Singleton Monostate Dependency Injection (DI) Comparisonatomosspace Programming vs Data-Oriented Design Other Potential Evaluationsatomosspace.com | 59 • Newer Isn’t Always Better • Consistently Reevaluate Alternatives • Use Case Determines Usability ConclusionGET TO YOUR PLACE0 码力 | 60 页 | 1.34 MB | 6 月前3
Exceptionally Bad: The Story on the Misuse of Exceptions and How to Do BetterP. All rights reserved. Exceptionally Bad: The story on the misuse of exceptions and how to do better Core C++ June 7, 2023 Pete Muldoon Senior Engineering Lead© 2023 Bloomberg Finance L.P. All rights The story on the misuse of exceptions and how to do better Core C++ June 7, 2023 Pete Muldoon Senior Engineering Lead Exceptions in C++ Better Design Through Analysis of Real World UsageWho Am I Look at Exceptions in both their use and design as seen in real code • Better thinking on the handling of error use cases • Better thinking on the design of an Exception class Warning May be controversialThings0 码力 | 85 页 | 2.32 MB | 6 月前3
Google 《Prompt Engineering v7》data so they can understand a prompt and generate an answer. But LLMs aren’t perfect; the clearer your prompt text, the better it is for the LLM to predict the next likely text. Additionally, specific few-shot prompt example, let’s use the same gemini-pro model configuration settings as before, other than increasing the token limit to accommodate the need for a longer response. Goal Parse pizza orders ways. It changes the final prompt doing the task by utilizing more knowledge in the LLM’s parameters than would otherwise come into play when the LLM is prompted directly. It can help to mitigate biases0 码力 | 68 页 | 6.50 MB | 6 月前3
Delivering safe C++Is what most programmers have tried to ensure since the dawn of time • The rules are more deduced than invented Stroustrup - C++ safety -CppCon - October 2023 8 Enforcement rules are mutually dependent user-defined types • consistent linking • Type-safe linking • Ensuring much better consistency across separate compilations • Not perfect, but now we can use C++20 modules Stroustrup - C++ safety -CppCon - October improvements can be achieved today, e.g., consistent range checking) • This is not just about safety • better use of the type system improves productivity • and often also improves performance Stroustrup -0 码力 | 74 页 | 2.72 MB | 6 月前3
Back To Basics Algorithms<< " " << pos->lastname << '\n'; } std::less{}, &Person::age ); You can do even better with std::ranges::min_element().28int main() { std::vectortable = // ... /* . isChild( p ); } ); // ... partition( first, last, []( Person const& p ) Again we can do better by using the C++20 ranges form of partition.int main() { std::vector table = /* .. )int main() { std::vector table = /* ... */; Fun with the Simpsons 48 20 That’s perfect reuse! // ... std:: { return isSeniorCitizen( p ); } ); ranges::partition( 0 码力 | 99 页 | 19.12 MB | 6 月前3
Back to Basics: The Factory Patternthoughts) ● Maybe a deadline hits, maybe it’s good enough, maybe we are tired... ● How about some better criteria--where I can check off three boxes ○ When we’re convinced our solution (especially if to figure out which vector to add to... ● I’ll give this score a 1 out of 3--we can probably do better.What Problem Am I Trying to Solve? Claim: If I have a user-driven application (e.g., a game) A into three categories: ■ Creational ■ Structural ■ Behavioral 41 *Keep in mind there are more than 23 design patterns in the worldDesign Patterns Book (2/2) ● So design patterns are reusable templates0 码力 | 93 页 | 3.92 MB | 6 月前3
Algorithmic Complexity(hopefully) know that O(n) is better than O(n2) 4Algorithmic Complexity @ CppCon 2021 Performance is the name of the game You all (hopefully) know that O(n) is better than O(n2) But there is still important 2021 Why this talk? Performance is the name of the game You all (hopefully) know that O(n) is better than O(n2) But there is still important stuff that might be overlooked And… 6Algorithmic Complexity 2021 Why this talk? Performance is the name of the game You all (hopefully) know that O(n) is better than O(n2) But there is still important stuff that might be overlooked And… the academic answer isn’t0 码力 | 52 页 | 1.01 MB | 6 月前3
Hidden Overhead of a Function APIExtra bool flag is required to know if the object ○ was actually initialized ○ not initialized more than once 37Does it solve our problems? Pros: ● Default constructor before the function call is avoided Extra bool flag is required to know if the object ○ was actually initialized ○ not initialized more than once Any C++ compiler checks that every execution path in a function ends with a return statement System V x86-64 System V x86-64 Microsoft If the argument type is a Composite Type that is larger than 16 bytes, then the argument is copied to memory. … the result is returned in the same registers0 码力 | 158 页 | 2.46 MB | 6 月前3
共 435 条
- 1
- 2
- 3
- 4
- 5
- 6
- 44













