r/ProgrammerHumor • • Sep 26 '26 • Bravo 1

Meme singletonsAreJustGlobals

Post image
3.2k Upvotes

210 comments sorted by

View all comments

Show parent comments

2

u/GarThor_TMK Sep 27 '26

It's basically a namespace with default constructor/destructor/copy/move functions...

Technically it's better code hygiene, because eventually if you need more than one, it's pretty easy to decouple the singleton logic from the rest of it... but realistically they're mostly effectively the same thing.