~/talk

C++ Code Smells

Talkat NDC TechTown 2019 · 2019-09-02..09-05· [developer-experience]
slides:none on file

Counts about 748 best-practice rules but narrows to concrete smells and fixes: construction vs assignment leads to needless temporaries but modern GCC9 often elides them; out parameters and raw loops become clearer with value returns and algorithms; watch redundant std::move that breaks RVO; avoid implicit conversions and const_cast that cause UB; replace static local strings with constexpr string_view to skip guard checks; run clang-tidy and enable precision warnings. The conclusion lists three actionable smells and specific tool checks that catch them.

AI-written summary · about

  1. 0:00Jason Turner
  2. 1:25C++ Best Practices
  3. 4:28Construction Separate From Assignment - Ben Deane
  4. 10:50Raw Loops
  5. 13:12Multi-Step Functions Multi-step functions are hard to reason about, debug, and maintain
  6. 19:03Non-Cannonical Operators
  7. 21:41Code With Conversions
  8. 25:29Casting Away const
  9. 28:56static const
  10. 34:16extern const
  11. 36:51Raw new and delete
  12. 37:13Code Smells
  13. 41:39Let's Update This Code Sample #2
  14. 46:56Do You const Value Parameters?
  15. 47:55Do you const Temporary Values?
  16. 52:18Do You const Value Return Types?
  17. 53:33Missing and Ignored Compiler Warnings Special checks for many of these things
  18. 53:59Missing const and constexpr, Misplaced const . Why isn't that value or member function
  19. 54:40Weak Types And Casts Unfortunately the C++ standard Ubrary does not help us here
  20. 55:31Bonus Code Review
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.