
Originally Posted by
kyberfabrikken
As a rule of thumb, globals are evil.
Or a bit more pronounced - A global is accessible from anywhere in the entire program. Each time you introduce a global, you thus potentially affect any part of your application. This means that with a complex application, the consequences are incomprehensible.
Possibly worse though, is that whenever someone (for example a thirdparty developer) needs to write any piece of code which interacts with you application (or indeed just run alongside it), the programmer will need to take each and every global into consideration.
Bookmarks