aks, 1 month ago Ok #cpp folks. Is using static always evil or is having something like game state (paused, running, in menu etc) inside a static variable ok? Or do i have to pass it around everywhere? #programming
Ok #cpp folks.
Is using static always evil or is having something like game state (paused, running, in menu etc) inside a static variable ok?
Or do i have to pass it around everywhere?
#programming
aeva, 1 month ago @aks static variables are fine. if it wasn't good, bjarne wouldn't have put it in c++
@aks static variables are fine. if it wasn't good, bjarne wouldn't have put it in c++
gracicot, 1 month ago @aks usually, you should use a static function scope variable to create a singleton. Then you do your stuff through it. I usually avoid global mutable variables though, or singleton of any form.
@aks usually, you should use a static function scope variable to create a singleton. Then you do your stuff through it.
I usually avoid global mutable variables though, or singleton of any form.
Add comment