5,321
edits
Line 580: | Line 580: | ||
[https://github.com/rigtorp/awesome-modern-cpp List of resources]<br> | [https://github.com/rigtorp/awesome-modern-cpp List of resources]<br> | ||
* Use RAII principles. | * Use RAII principles. | ||
** I.e. each object should manage it's own memory rather than the caller having to manage it. | |||
** You should never use `malloc` and `free` unless interfacing with C libraries. | |||
* Use smart pointers instead of new and delete. | * Use smart pointers instead of new and delete. | ||
** Namely, <code>std:: | ** Namely, <code>std::unique_ptr</code>, <code>std::shared_ptr</code>, and <code>std::vector</code>. | ||
* Use clang-format. | * Use clang-format. | ||