Re:How to make Flappy Bird with C++
by a_t48 on Thursday August 25, 2022 @10:22AM
(#32594083)
Disagree - it's very reasonable for resources to be shared.
[ Parent
| on HN ]
This is C++.
You should not pay the performance hit for features you don't need in a particular program.
In fact: It is reasonable for C++ programs to NOT use all language features.
I'm not disagreeing with you.
In most cases, not. Where there is a legitimate reason to share, share. Without, it is just sloppiness.
In the context of a game engine, I mean. You may be sharing a model or texture between multiple entities, and want to know when it’s no longer in use.
Even there, something higher up the stack probably knows too, and is in a better position to choose a good time to dispose of it.
Possibly! It really depends on how you've architected things. I said it's "reasonable" not that it's the one true way of implementing it.