I still occasionally write C++ when I need to, but it's been a long time since I actually enjoyed doing it.
[1]:https://www.amazon.com/C-Crash-Course-Josh-Lospinoso/dp/1593...
So, sure, all the code from people learning "modern C++" is smart pointers and ranges, but to get work done you have to call this library that takes raw pointers and you're immediately out of your depth.
C++ soldiers on because it can support such things and adapt to decades of changing hardware and philosophy. But the pain of using and composing libraries in C++ is not just about not having cargo or npm - it's the lack of consensus on data types for anything beyond C primitives.
Everything uses/supports standard library containers or interfaces now.
Also it's still completely normal to use raw pointers or references when a function doesn't care about ownership.
I am an old man, and to me 2011 doesn't feel ancient, but fair. C++ 11 has unique_ptr and shared_ptr (if your library uses a previous generation of smart pointers you're in worse trouble than if it had raw pointers) and that's what you'd probably teach in class today.
> Also it's still completely normal to use raw pointers or references when a function doesn't care about ownership.
This is true. So you can't tell. And, with a different hat on it's also something that Kate Gregory has given talks about. As the new maintainer for several MLOC of C++ what can I conclude about this function that takes a raw pointer to a foo ?
Maybe, it just wants to look at a foo, immediately and then has no further interest in it.
Maybe, it will mutate the foo, immediately, and then loses interest.
Maybe, it will hang on to this pointer and use it later, who knows when. Thus, now it "owns" the foo, I hope it will clean up after it ceases using it because I can't now.
Maybe, I'm supposed to provide an "empty" foo and the contents of it afterwards are the primary result of the function.
Those are pretty different, so it's disappointing that we don't learn which it is from the function signature.
Some projects in mind:
C++/SFML/SDL2 game programming using modern C++
Interpreter/compiler construction in modern C++
Explains how to implement things in modern C++ (e.g.unique_ptr) without modern C++ (maybe just use C)
Solving somewhat complex problems with standard data structures (maps, trees, hashtables, etc.) and doing it in the modern, efficient way is the kind of thing I'm really looking for.
In Python it's easy (which isn't to say everything should use Python) because you don't have to do anything but use the builtin datastructures and solve your problem.
Maybe modern C++ works the same way but if it does, I still need someone to show it since that isn't how it used to be (to my knowledge).
Eventually I just gave up and use raw pointers. My theory is that since people don't care about JVM not returning memory to system, they should also not care a bout a few MBs of memory leak in my small game.