Top all-time · #2307
C++ Stories
Personal blog · cppstories.comprogramming
C++ Stories is a personal blog at cppstories.com about programming. Since 2020, 35 different Hacker News readers have linked it 143 times, most often “A New Book: Data Member Initialization in Modern C++”. It is still writing: the last post was on 2026-10-11, and you can follow it by feed.
Stay up-to-date with Modern C++
Most-linked posts?
- A New Book: Data Member Initialization in Modern C++4 people · 4 mentions · first linked 2022-06-20
- How to Stay Sane with Modern C++3 people · 3 mentions · first linked 2021-02-28
- Understanding std:counting_semaphore and std:binary_semaphore from C++203 people · 3 mentions · first linked 2026-08-08
- How to Init a String, Looking for Sanity3 people · 3 mentions · first linked 2022-08-29
- /2023/init-story-print/2 people · 2 mentions · first linked 2023-03-28
- Finite State Machine with Std:Variant – Vending Machine2 people · 2 mentions · first linked 2023-07-10
- How to Improve or Avoid Loops in C++20 232 people · 2 mentions · first linked 2022-09-26
- Embracing Modern C++ Safely, Book Review2 people · 2 mentions · first linked 2022-05-30
- Custom types and std:format from C++202 people · 2 mentions · first linked 2022-07-25
- Understanding Std:Shared_mutex from C++172 people · 2 mentions · first linked 2026-02-15
What Hacker News says?
Some of C++ features are great, as recently discussed on the Linux kernel mailing list. However for many of Cs usecases, they are not appropriate, like exceptions and RAII in embedded. Once you start disabling major features those 'power tools' become far less attractive. Also, to extend the metaphor, hand tools are usually obvious and easy to use while power tools can have very long manuals. See for example the 275…
Comment linking /2022/cpp-init-book/
on “C23: A Slightly Better C”Submitted C++26 Contracts: Introduction to Preconditions and Postconditions as a story · 151 points
HN discussionSo, what programmers wanted (yes, already before C++ got this) was what are called "destructive move semantics". These assignment semantics work how real life works. If I give you this Rubik's Cube now you have the Rubik's Cube and I do not have it any more. This unlocks important optimisations for non-trivial objects which have associated resources, if I can give you a Rubik's Cube then we don't need to clone mine,…
Comment linking /2023/init-story-print/
on “In Defense of C++”Submitted Embracing Modern C++ Safely, Book Review as a story · 135 points
HN discussionIsn't that what the linked website is for? https://www.cppstories.com/p/start-here/
Comment linking /p/start-here/
on “Curious C++ Lambda Examples: Recursion, constexpr, Containers C++23 included”Submitted Enum class improvements for C++17, C++20 and C++23 as a story · 103 points
HN discussionThis book `Embracing Modern C++ safely` just showed up in my book feed, you may find it useful. [1] is a review of the book. [1] https://www.cppstories.com/2022/embracing-modern-cpp-book/
Comment linking /2022/embracing-modern-cpp-book/
on “Ask HN: What are some good resources to learn safety-critical C/C++ coding from?”Submitted C++26: Standard Library Hardening Experiments as a story · 91 points
HN discussionRead through https://www.learncpp.com . You'll get a complete refresher on the language, but it will be using modern C++ stuff (modern in this case means C++17). For C++20 and newer, honestly, the only big feature that I ever use is concepts, although I do also use the new struct initialization syntax[0]. [0]: https://www.cppstories.com/2021/designated-init-cpp20/
Comment linking /2021/designated-init-cpp20/
on “Ask HN: Catching Up on C++?”Submitted C++ String Conversion: Exploring std:from_chars in C++17 to C++26 as a story · 77 points
HN discussionHere's the direct link to the blog post on the book: https://www.cppstories.com/2023/init-story-print/ And the book at Leanpub: https://leanpub.com/cppinitbook
Comment linking /2023/init-story-print/
on “Initialization in Modern C++ (295 pages)”Submitted Curious C++ Lambda Examples: Recursion, constexpr, Containers C++23 included as a story · 67 points
HN discussionIt depends on what problem you are trying to solve, your programming style, and the size of your team. I personally will avoid C++ if possible because it has too much complexity, too many "gotchas", and there are better choices available (Rust, Go, Ada, C, etc.). Some people like C++ and that is fine. They can use it. I will use something else if at all possible. https://en.wikipedia.org/wiki/Criticism_of_C%2B%2B ht…
Comment linking /2022/cpp-init-book/
on “Ask HN: What’s bad about C++? I kinda like it”Submitted C++20 Ranges Algorithms – Non-Modifying Operations as a story · 63 points
HN discussionThere are discussions in many places about this, including right here on HN. I encourage you to Google it. Here are some examples: https://news.ycombinator.com/item?id=24537267 https://www.cppstories.com/2018/01/pimpl/#pros-and-cons It used to be a widely advertised technique maybe a decade ago, but it has long gone out of style.
Comment linking /2018/01/pimpl/
on “Speed Up C++ Compilation”Submitted C++ Software Security Sins: Basic Issues as a story · 57 points
HN discussionSorry, I still don't get how it's different from C++, and my point wasn't about `auto` but rather about `std::vector v2`: std::vector v2 (v1.begin() + 1, v1.begin() + 2); > However, in the provided example, the Rust type checker can use the provided clue to narrow this down to an exact type The Rust example is incomplete and its RHS by the time it gets to `.collect()` within the context of `iterator` has to be bound…
Comment linking /2021/concepts-intro/
on “Rust vs. Haskell”Submitted C++20 Oxymoron: Constexpr Virtual as a story · 54 points
HN discussionhttps://www.cppstories.com/2026/shared_mutex/#newer-concurre... > Since C++17, the concurrency library has expanded significantly. We now have: > ... > safe memory reclamation mechanisms (RCU, hazard pointers in C++26) > These tools focus mostly on thread lifetime, coordination, cancellation or lock-free programming. > std::shared_mutex fills a different role. > It is still a mutual-exclusion primitive, explicitly d…
Comment linking /2026/shared_mutex/
on “Understanding Std:Shared_mutex from C++17”Submitted C++ Templates: How to Iterate through std:tuple: std:apply and More as a story · 47 points
HN discussionLess known fact is that it's called C++23 because there are 23 ways to initialize a variable. Of course, it's a joke. In reality C++23 has only 20 ways to initialize a variable: https://www.cppstories.com/2022/init-string-options/ https://blog.tartanllama.xyz/initialization-is-bonkers/
Comment linking /2022/init-string-options/
on “Const vs. constexpr vs. consteval vs. constinit in C++20”Submitted Integer Conversions and Safe Comparisons in C++20 as a story · 46 points
HN discussionSubmitted Adjacency Matrix and std:mdspan, C++23 as a story · 35 points
HN discussionSubmitted Implementing Parallel Copy_If in C++ as a story · 29 points
HN discussionSubmitted All Major C++17 Features You Should Know as a story · 22 points
HN discussionSubmitted Sfinae, Immediate Context, Operator as a story · 14 points
HN discussionSubmitted How to join or concat ranges, C++26 as a story · 13 points
HN discussionSubmitted C++20 Concepts – A Quick Introduction as a story · 8 points
HN discussionSubmitted C++ Smart Pointer Gotchas (2013) as a story · 5 points
HN discussionSubmitted Std: Initializer_list in C++ – Caveats and Improvements as a story · 4 points
HN discussion