HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”

CppCon · Youtube · 26 HN points · 4 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention CppCon's video "CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”".
Youtube Summary
http://CppCon.org

Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2017

I've spent the last few years watching Facebook's C++ codebase grow by several orders of magnitude. Despite constantly improving abstractions, constantly improving tooling, frequent internal courses, and ongoing internal discussion, there are bug-patterns we simply cannot stop from being reintroduced into our code. My hope is to show some of the most common (and infamous) bugs in our history, and the surprising complexity that arises in some apparently simple situations.

This talk serves the dual purpose of educating the intermediate (and perhaps the occasional advanced) C++ programmer about some really nasty common pitfalls, as well as serves as a plea to experts to help further improve the language, libraries, and best practices to help educate and eradicate some of these problematic patterns.

Louis Brandy: Engineering Director, Facebook

My team is responsible for the overall health of the Facebook C++ codebase, both the tools and the libraries. We work on: compilers, static/dynamic analysis, linters, large scale changes, and the core libraries.

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

*-----*
Register Now For CppCon 2022: https://cppcon.org/registration/
*-----*
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Sep 22, 2022 · maxbond on Lockfree Algorithms (2010)
Related talk from cppcon: https://youtu.be/lkgszkPnV8g
Feb 12, 2022 · 3 points, 0 comments · submitted by fagnerbrack
Jun 23, 2021 · slavik81 on My favourite C++ footgun
I'm a big fan of Scott Meyer's Effective C++. It's a little dated now, but it was the most valuable book I'd ever read on the language.

Louis Brandy's Curiously Recurring Bugs at Facebook presentation from CppCon17 has somewhat of the same feeling, though it only covers a few bugs: https://youtu.be/lkgszkPnV8g

Jan 29, 2020 · wyldfire on C++20 Reference Card
No. Sorry for being unclear. [1] is a great video that covers a lot of good stuff in particular this usability bug. It's worth watching in its entirety.

If you don't want to sit through the video, here's the broken code in question:

    void Obj::update() noexcept {
        unique_lock<mutex>(m_mutex);
        do_the_mutation();
    }
"unique_lock<mutex>(m_mutex);" has no effect, but you might mistakenly think that this will block on m_mutex. Labeling unique_lock's constructor as [[nodiscard]] would force you to think twice. See [2] for more details.

[1] https://youtu.be/lkgszkPnV8g?t=1767

[2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p177...

mehrdadn
Ahh, that makes sense! On my phone at the moment but will check out the video too, thanks!
It can be as fast as C++ whilst at the same time suffering from none of these bugs:

https://www.youtube.com/watch?v=lkgszkPnV8g

May 10, 2018 · 21 points, 2 comments · submitted by victorvation
lainga
#6 really got me (won't spoil it for anyone, but): is this the same reason arr[n] and [arr]n are the same in C? The {square,curly} braces are just sugar?
caraffle
I don't think it's the same. arr[n] and [arr]n works because brackets simply expand to * (arr + n) in the first case, * (n + arr) in the second.

C++ dictates if a statement can be interpreted as a declaration, it will be (see "The most vexing parse"). Universal initialization was introduced to provide another way to ensure this doesn't happen.

https://softwareengineering.stackexchange.com/questions/1336...

Nov 08, 2017 · 2 points, 0 comments · submitted by pjmlp
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.