4 ms·
Global logging in libraries is not uncommon, especially if you need to trap signals (which can only interact with global state). COM APIs expose a global class
by holy_city 7y ago
Global logging in libraries is not uncommon, especially if you need to trap signals (which can only interact with global state).
COM APIs expose a global class factory as the main interface to a shared libraries.
Embedded systems and drivers require globals in one form or another.
"Globals are evil" comes from the fact that globals have side effects, and side effects make things hard, especially in modern software that utilizes asynchronous/concurrent logic. That just makes them unwieldy, not unnecessary. Especially when interacting with legacy systems that require globals.