CppCon 2014: Herb Sutter "Back to the Basics! Essentials of Modern C++ Style"
Why Hacker News recommends it
HN people list it among the go-to talks for learning or refreshing modern C++ style, and cite it for Sutter's guidance on function parameter passing.
What it is
Herb Sutter revisits basic C++ questions in light of C++11 and C++14: how to declare and initialize variables, pass values to functions, write loops, and use smart pointers. It covers auto, rvalue references, range-for, uniform initialization, lambdas, unique_ptr and shared_ptr.
Recommended by 2 HN commenters across 2 different months, 2014 to 2021.
What Hacker News said
Recommends jerv · 2014-12 · on “Ask HN: How to refresh on modern features of C++?”
Herb Sutter, one of the most prolific C++ experts out there, recently gave a talk on Modern C++ [1]. In the beginning of his talk, he states that every C++ developer should read a "Tour of C++" [2] by Bjarne Stroustrup, the original designer of C++. I recently read it and it's great. The book has less than 200p, but still covers the most important parts of C++11, albeit not in great detail (the reader is pointed to "The C++ Programming Language" by the same author for that). Read it! And watch the youtube video in [1]. [1] [this video] [2] [LINK]
Recommends pjmlp · 2018-03 · on “Ask HN: Best way to learn modern C++?”
- Tour of C++ ( [LINK] ) - Principles and Practice Using C++ ( [LINK] ) - From Mathematics to Generic Programming ( [LINK] ) - The Scott Meyers books Some of the Bjarne Stroustrup videos, "Learning and Teaching Modern C++" - [LINK] Some of the Herb Sutter videos, "Writing Good C++14... By Default" - [LINK] "Back to the Basics! Essentials of Modern C++ Style" - [this video] Some of the Kate Gregory videos, "Stop Teaching C" - [LINK] "10 Core Guidelines You Need to Start Using Now" - [LINK] "It's Complicated" - [LINK]
Cites legends2k · 2019-11 · on “Cheat Sheet: C++ Function Parameter Choices [pdf]”
In our 60+ team of C++ programmers, a constant theme that keeps coming up in code reviews is how a function optimally takes its parameters. There's been enough overthinking and I came across Herb Sutter's CppCon 2014 Essentials of Modern C++ Style [1] where he explains the various cases. I made a cheat sheet (1-page PDF) for quick reference of the options and when to go for them. Comments and suggestions welcome! GitHub project [2]. # Credits - Herb Sutter, other C++ experts and the community - Emacs[3] and Org-mode[4] creators - CheatSheet by Musa Al-hassy # Links [1]: [this video] [2]: [LINK] [3]: [LINK] [4]: [LINK] [5]: [LINK]
Cites oconnor663 · 2021-05 · on “Things you can’t do in Rust (and what to do instead)”
ASan, UBSan, etc. are absolutely life-changing, no doubt about it. But there's a pretty big difference between catching things statically, and catching them at runtime. If you have an issue that, say, only triggers on odd-numbered Tuesdays on Windows 7, your tests suite is probably going to miss it, and ASan isn't going to be able to help you. Here's an example from one of Herb Sutter's talks, which I refer to frequently. He describes an issue that can come up with shared_ptr in reentrant/callbacky code, and the punchline is that you have to be careful never to dereference a shared_ptr that might be aliased: [this video] I also just wrote a giant example of my own :) in reply to your toplevel com