I Don’t get the hatred around global variable in programming world. There are tons of articles in the net explaining why programmer must stay away from it. Well I’ve been programming for about ten years, yet I found global variable is really a gift.
Most of the reasoning behind the hatred is code maintainability. That is kind of ridiculous, a well written code will be easy to maintain, and badly written one will be hard to maintain regardless of global variable usage.