Testing a student's aptitude and teaching them how to program efficiently should not be done at the same time. At least at my university, we have at least 5 modules on programming/software development, each refining the knowledge of the previous one. Going higher and higher through the layers of abstraction. Squeezing all that content into a single module leads to that famous "implement your own list even though STL has one" scenario. We got to implement our own lists too, but in the context of C not C++ or any other OOP language the provides them already. Care was taken to also make sure no bad habits are created, penalizing us for not free()ing memory in C etc. although it would not have made a difference to a lazy programmer.
I don't know whether I just got lucky to be at my university, but I assume that given enough effort and good will, even with the crappiest courses you can become a pretty decent software developer if you care enough. The reverse is also true, even if you have the best courses in the world but don't give a damn about clean code, god help you.
The funny thing at universities is that, in the courses for students, they preach all the good stuff, but if you look at the code they use as part of their research you can hardly believe it was them who wrote it
. Must be the time/financial pressure
. This is probably also the reason all the bad stuff you listed made it into those other libraries. They wanted to get something out the door fast, no matter what. And since refactoring takes time away from "productive development" nobody ever cares once the codebase is there. Yes, management often doesn't care about RAII, and don't even try convincing them, you are better off refactoring yourself without their consent.
Isn't the pattern of:
#ifndef FOO
#define FOO
... code ...
#endif
in headers a bit of a relic of C days that was replaced with patterns like:
#pragma once
... code ...
That is a tricky one, because technically, #pragma once isn't standardized so if you want to get code to compile on some arcane (but standards compliant, like that even exists) compiler, you are safer using the first variant.