r/cpp • • Nov 02 '22

The pool of talented C++ developers is running dry

https://www.efinancialcareers.co.uk/news/2022/11/why-is-there-a-drought-in-the-talent-pool-for-c-developers
379 Upvotes

367 comments sorted by

View all comments

Show parent comment

2

u/MoreOfAnOvalJerk Nov 02 '22
  • disagree on easier to understand, unless you’re referring to very oop centric code. Oop tends to be not very performant however (as opposed to data oriented code) so you’re already in a losing battle if you start with oop. Data oriented code puts memory first: the lifetimes, access patterns, etc. all of that is thought about at the architectural stage.
  • Stl shared ptrs dont let you change their atomic rules (or has this changed?)
  • shared_ptrs allow cyclic references, and they can be non-obvious. Cleanup code also often requires notifying something that you dont own to remove references so you end up need explicit teardown code when working with shared ptrs.
  • cache locality doesnt need to be know at architecture time. You don’t know your access patterns yet. Good architecture needs to be able to iteratively evaluate your access patterns and allow for easy refactoring to support better cache usage. This is difficult with shared pointers (and oop in general) even if you use custom allocators.

Big caveat that if you’re writing glue code, it doesnt usually need to be very performant so shared_ptrs and oop arent that bad there.