r/cpp • u/claimred • Apr 20 '26
Software taketh away faster than hardware giveth: Why C++ programmers keep growing fast despite competition, safety, and AI
https://herbsutter.com/2025/12/30/software-taketh-away-faster-than-hardware-giveth-why-c-programmers-keep-growing-fast-despite-competition-safety-and-ai/Refreshing take by Herb. Slides here
230
Upvotes
View all comments
Show parent comment
2
u/pjmlp Apr 20 '26
A random file from the same repo,
https://github.com/microsoft/DirectX-Graphics-Samples/blob/master/MiniEngine/ModelConverter/ModelOptimize.cpp
Makes use of
memset,memcpy, C style pointer arithmetic, nakednewanddelete, enums as constantsFor it to fulfill the C++ way that gets told as "we don't do C any longer",
Instead of the
string.hfunctions, it should have used array fill and move algorithms, instead of pointer arithmetic, span and views, instead ofnewanddelete, unique pointers, instead of enums as constants, constexpr.While some of those are indeed valid C++, they aren't modern best practices C++, and naturally
string.hrelated functions and the pointer arithmetic would compile as C code as well.There are other files to deconstruct on a similar way on the same repo.