3 ms·
> global variables are considered bad design Global mutable variables, and they usually tend to be grouped into singletons (solving initialization issues, and
by TuxSH 10mo ago
> global variables are considered bad design
Global mutable variables, and they usually tend to be grouped into singletons (solving initialization issues, and fewer people bat an eye)
- RealityVoid 10mo agoEven global mutable variables are a problem only because they lend to spaghetti code and messy state handling if you use them in multiple places. But you could just... make a global variable and then handle it like you would a variable init with malloc. No functional issue there.