WHY did this C++ code FAIL?
The Cherno The Cherno
646K subscribers
197,785 views
0

 Published On May 31, 2024

To try everything Brilliant has to offer—free—for a full 30 days, visit https://brilliant.org/TheCherno . You’ll also get 20% off an annual premium subscription.

Patreon ►   / thecherno  
Instagram ►   / thecherno  
Twitter ►   / thecherno  
Discord ►   / discord  

CODE ► https://github.com/luizfelipemb/OresSDL

Hazel ► https://hazelengine.com
🕹️ Play our latest game FREE (made in Hazel!) ► https://studiocherno.itch.io/dichotomy

🌏 Need web hosting? ► https://hostinger.com/cherno

Send an email to [email protected] with your source code, a brief explanation, and what you need help with/want me to review and you could be in the next episode of my Code Review series! Also let me know if you would like to remain anonymous.

📚 CHAPTERS
0:00 - Hello
1:29 - ALWAYS stack allocate if you can
4:20 - The cat is back
4:36 - API design considerations
7:27 - return 0 in the main function
8:31 - Organization and code conventions
11:22 - Variable intialization
14:44 - Deep class hierarchies
18:12 - Managing states
20:58 - defines
25:32 - Avoid copying causing unnessary heap allocations
26:38 - More on #define
28:50 - Consistent code style
30:33 - Compilation warnings
31:13 - Logging and release builds
32:30 - struct vs class
33:16 - Cleaner code
35:21 - Final thoughts and conclusion
36:48 - Use std::weak_ptr

💰 Links to stuff I use:
⌨ Keyboard ► https://geni.us/T2J7
🐭 Mouse ► https://geni.us/BuY7
💻 Monitors ► https://geni.us/wZFSwSK

This video is sponsored by Brilliant.

show more

Share/Embed