Why I Dont Like Singletons @TheCherno
Why I Dont Like Singletons  @TheCherno
Uploaded August 2024 | Updated September 2026, 2 weeks ago
To try everything Brilliant has to offer—free—for a full 30 days, visit brilliant.org/TheCherno . You’ll also get 20% off an annual premium subscription.

Patreon ► patreon.com/thecherno
Instagram ► instagram.com/thecherno
Twitter ► twitter.com/thecherno
Discord ► discord.gg/thecherno

🔗 LINKS
Meyers' Singleton ► laristra.github.io/flecsi/src/developer-guide/patterns/meyers_singleton.html
Radar Contact code ► github.com/Bogdanctx/Radar-Contact

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

🌏 Need web hosting? ► hostinger.com/cherno

📚 CHAPTERS
0:00 - Comments and the Community
3:41 - The Comment
4:52 - Singletons and Context
8:47 - Lazy Loading
10:35 - Why are singletons "bad"?
15:51 - Having a "global variable" is "better"
16:23 - Reviewing Meyers' Singleton
19:38 - Improving our singleton to make shutdown explicit
21:11 - Not storing our instance in static storage
22:56 - Removing lazy loading to make initialization explicit
23:47 - The "global" situation - my solution

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

This video is sponsored by Brilliant.
Why I Dont Like SingletonsLoading Levels // Remaking My First Game in C++Logging is FINALLY good in C++! 🎉Make C++ Apps & Games FOR THE WEBGoodbye (kind of)DONT DELETE THIS! // Bugs of C++Our biggest release ever... Hazel 2023.1Naming Conventions in C++Remaking My First Game in C++BINARY vs TEXT File SerializationWeak Pointers in C++ (std::weak_ptr)I used AI to do a C++ University Assignment
The Cherno |

Why I Don't Like Singletons

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER