4 ms·
Please. Just don't. Moving state into the global namespace and accessing it directly from that space makes it much more difficult to test, instrument and integ
by anymouse123456 2y ago
Please. Just don't.
Moving state into the global namespace and accessing it directly from that space makes it much more difficult to test, instrument and integrate.
Sure, if you're building disposable toy software, do whatever is easiest. But if you're building software for others to use, at least provide a context struct and pass that around when you can.
For those cases where this is challenging or impossible, please sequence your application or library initialization so that these globals are at least fungible/assignable at runtime.