3 ms·
To write safe C++ you need moral discipline, rather than intellectual/cognitive. The language has the tooling. Moral discipline means rejecting the use of unsa
by kazinator 3y ago
To write safe C++ you need moral discipline, rather than intellectual/cognitive. The language has the tooling.
Moral discipline means rejecting the use of unsafe constructs for the sake of speed or convenience, and doing the safer, slower, sometimes more clumsy thing.
For instance, to skip thinking like "oh, we can just retain a direct pointer into here, and then we don't need to make a copy ...".
And, of course, while that is all well, you can only practice this advice only applies to small team or solo greenfield projects.