Bartek's Coding Blog

bfilipek.com · Personal blog · on HN since 2013

Bartek Filipek writes in-depth posts on modern C++ features, covering C++17 and C++20 topics such as variant, SFINAE, and parallel algorithms.

What HN saysHN commenters recommend it as a great C++ blog that covers each feature at length, plus his C++17 book and survey data on C++ use.
49HN people shared it
13linked it in comments
219stories submitted
2.1Kstory points
5 years agolast shared
2013people per year2026

Most-shared posts

  1. 1
    How to Stay Sane with Modern C++
    5 people · 20 points · first shared 2017 · 1 comments on HN
  2. 2
  3. 3
    Deprecating Raw Pointers in C++20
    3 people · 179 points · first shared 2018 · 78 comments on HN
  4. 4
    Simplify code with 'if constexpr' in C++17
    3 people · 9 points · first shared 2018 · 1 comments on HN
  5. 5
    C++ at the End of 2019
    3 people · 7 points · first shared 2019 · discussion on HN
  6. 6
    C++17 in details: Parallel Algorithms
    3 people · 4 points · first shared 2017 · discussion on HN
  7. 7
    How unique_ptr enhances resource safety in your code
    3 people · 4 points · first shared 2017 · discussion on HN
  8. 8
    C++: How to Use Std::visit with Multiple Variants
    3 people · 2 points · first shared 2018 · discussion on HN
  9. 9
    C++20 Reference Card
    2 people · 119 points · first shared 2020 · 42 comments on HN
  10. 10
    C++: Vector of Objects vs. Vector of Pointers
    2 people · 69 points · first shared 2014 · 50 comments on HN
  11. 11
    Top 5 Beautiful C++ std Algorithms Examples
    2 people · 19 points · first shared 2014 · 1 comments on HN
  12. 12
    C++ Status at the end of 2017
    2 people · 14 points · first shared 2017 · discussion on HN
  13. 13
    Quick case: Char Pointer vs. Char Array in C++
    2 people · 11 points · first shared 2014 · 4 comments on HN
  14. 14
    I Improved My Legacy C++ Project with PVS-Studio
    2 people · 6 points · first shared 2020 · 1 comments on HN
  15. 15
    Notes on C++ SFINAE
    2 people · 5 points · first shared 2016 · discussion on HN

What HN people wrote when they linked it

shaklee3 · 2019-11-06
This book is worth checking out if you don't know c++17: https://www.bfilipek.com/2018/08/cpp17indetail.html?m=1 That guy has a great blog where he writes at length about each feature, and the book is a compilation of that.
blojayble · 2017-07-25
pjmlp · 2020-01-16
According to most surveys, they aren't used as much on real life. Here 14%, https://www.jetbrains.com/lp/devecosystem-2019/cpp/ Here 40 - 55%, https://www.bfilipek.com/2019/12/cpp-status-2019.html At CppCon 2015 or something, at Herb's question during his keynote, about 1% of the audience as per his comment on the video.
lenkite · 2019-11-08
You have std::variant and std::visit. https://www.bfilipek.com/2018/09/visit-variants.html Or you can use a library: https://github.com/mpark/patterns
lmm · 2019-11-08
> You have std::variant and std::visit. https://www.bfilipek.com/2018/09/visit-variants.html Which isn't a true sum type because it doesn't nest properly. > Or you can use a library: https://github.com/mpark/patterns Interesting; proper pattern-matching is nice, but the lack of type safety is still a major issue.
cesarb · 2018-04-01
Having started using the Internet in the 90's, and thus still remembering Geocities-era websites, I loved that they did this as a webring (https://en.wikipedia.org/wiki/Webring): each blog post has a link to the next one, making a singly-linked circular list. Starting with this one, we have: - http://www.bfilipek.com/2018/04/deprecating-pointers.html - http://www.modernescpp.com/index.php/no-new-new - https://www.fluentcpp.com/2018/04/01/cpp-will-no-longer-have-pointers/ - https://blog.tartanllama.xyz/no-pointers/ - https://arne-mertz.de/2018/04/raw-pointers-are-gone/ And it circles back to this one.
Findeton · 2018-04-01
smitherfield · 2018-02-21
Should be noted that so far only Visual Studio (partially) implements C++17 parallel algorithms, although there are several third-party implementations.[1] Apples to oranges comparison of course, since Rayon isn't [planned to become?] part of the Rust standard library. [1] http://www.bfilipek.com/2017/08/cpp17-details-parallel.html#current-im…
ashleyn · 2017-12-05
For me, the parallelism TS is the Big F*ing Deal: http://www.bfilipek.com/2017/08/cpp17-details-parallel.html
DerDangDerDang · 2017-06-23
I don't own it, but this book sounds like it may be what you're after: http://www.bfilipek.com/2017/06/modern-c-programming-cookbook-review.h…
bluescarni · 2020-05-29
> So you're saying if the code was higher quality it would have fewer bugs? I mean, well, yeah. That's not what I am saying, at all. You cannot do RAII in C. My point was that I believe that most of the bugs under discussion here would not have happened if a language that provides RAII capabilities had been used. > The problem with solutions like RAII is that it doubles down on programmer infallibility, from "good programmers don't write bugs" to "good programmers correctly use RAII." > You haven't really solved the actual problem unless you have tooling available that won't let non-RAII be checked in at all. Does that exist? I don't understand what you are trying to say honestly. If you think that RAII requires the same level of attention and care as manual malloc()/free()/new/delete, then this makes me wonder if you even know what the point of RAII is. Given the same "programmer quality" (for the lack of a better term), the use of RAII will certainly reduce the occurrence of memory mismanagement bugs. For the tooling, you can use clang-tidy in C++ to enforce the use of smart pointers, make_unique, etc. E.g., see: https://www.bfilipek.com/2017/12/why-uniqueptr.html (I am sure there are other static checkers around that can spot the use of manual memory management functions, it's an easy thing to check for). So, please don't put words in my mouth. The claim was never that RAII gives you the mathematical certainty of the absence of certain classes of bugs. Rather the…
arcticbull · 2019-07-13
Not all of them, to be sure, lambdas and in particular their capture list syntax is solid. By no means is that universal though, for instance, move semantics. std::move doesn't move anything, it casts an object as a movable reference (equivalent to static_cast<T&&>). The compiler doesn't preclude you from accessing the old object (or say anything at all) and there's no guarantee it actually did get moved, it's just a hint. That's not real move semantics, it's a shoddy knock-off. You also have to manage a new constructor, new reference type and the opt-in because the default remains not using move semantics. Worse yet, there's varying agreement on what you can or should do with the source of a moved value, the STL containers will all continue to let you use the old value, it's just empty now. That's not standard behavior because there is none, and it's de facto now because it's in the STL. What a nightmare. [1] std::variant is supposed to be associated values on enums, but of course, it doesn't do that either. You don't match, you create a new struct with a bunch of operator() methods on it [or overload a lambda?!] and throw it at std::visit. You can only have one variant of each type. Then it throws exceptions if you start mucking about in ways you shouldn't. There's no context. It's dreadful. [2] [1] http://yacoder.guru/blog/2015/03/14/cpp-curiosities-std-move-that-does… [2] https://www.bfilipek.com/2018/06/variant.html

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close