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 A

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 app

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 applica

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? Beca

RE: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread Steven Sacks
06 2:25 PM > To: Flashcoders 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 l

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 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 P

[Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread David Stiller
In the last few days, I've seen a handful of people refer apologetically to use of the _global object. To paraphrase: "I'm in a situation where I have to use _global variables," or, "We all know _global is a no-no, but I'm tempted to use it in this one weird case," etc. In general, this