Re: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread Ramon Miguel M. Tayag
I suppose it's the use of variables in _global. That's what I avoid. Else, 5 years later, when you've got extensive classes, and something ddoesn't work, it might be because some variables overwrite one another in _global. That'd take almost forever to debug. On 3/24/06, David Stiller [EMAIL

Re: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread Rich Rodecker
yeah its yuck, though i use it myself here and there for the cheap hack that it can be. i think generally most programming languages (or the prgrammers using those languages) look down upon global vars. i think the idea is that it pretty much destroys encapsulation and object-oriented principles.

RE: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread Steven Sacks
mailing list Subject: Re: [Flashcoders] Wherefore the evils of _global? yeah its yuck, though i use it myself here and there for the cheap hack that it can be. i think generally most programming languages (or the prgrammers using those languages) look down upon global vars. i think

Re: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread ryanm
What I don't understand -- and I hasten to say I have no opinion on the matter, yet -- is why _global is so shunned. After all, _global is exactly where AS2 classes are located. Is this a religious issue? Is it because of how _global gets shared (or not?) among dynamically loaded SWFs?

Re: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread Tyler Wright
On 3/23/06, ryanm [EMAIL PROTECTED] wrote: Because global variables are contrary to the basis of OOP, which is all about abstraction and encapsulation. If you need to store variables somewhere so that they can be reached anywhere, use a singleton, or a static class, or an application

RE: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread David Stiller
Responding to two, here ... ryanm wrote: Because global variables are contrary to the basis of OOP, which is all about abstraction and encapsulation. If you need to store variables somewhere so that they can be reached anywhere, use a singleton, or a static class, or an application

Re: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread ryanm
Okay, I'm with you. That jibes with my understanding of OOP in a universal sense. In ActionScript, however, classes *are* properties of the _global object, which is what prompted my question. Programmers in general may agree to avoid global variables in principle, and what I'm hearing is that