>> Event listeners also can not return any value. Ha. That isn't true at all, you can send data with events. I do it all the time, and it's not bad practice.
>> Events are worse than just calling the right >> method to begin with. Events are too loosely coupled if you ask me. Well, you use event listeners to call the right event. I don't think telling someone to avoid root and use events is elitist at all - especially when it's easy to learn. The only time it's wise to use root, in my opinion, is when you don't know how to do anything else. But using root by it's ver nature is tight coupling code, it's also symptomatic of code lying all over the place. >> For events you still need an object to dispatch them on. Yes, obviously, just like when YOU write "root blah blah" - you have to script that code from an object as well. >> Or we could just cut out all this theorist cruff and focus on the issue at hand. How would you replace the root property? That's exactly what I'm answering, you would replace "root" with event dispatchers and event listeners. I guess root isn't evil, it's just very very ugly. So I think we'll just have to agree to disagree and leave it at that. Jason Merrill Bank of America Global Learning Learning & Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Henrik Andersson Sent: Monday, February 22, 2010 11:49 AM To: Flash Coders List Subject: Re: [Flashcoders] 2.0 => 3.0 Merrill, Jason wrote: > No - I mean just broadcasting events instead of coupling code across > timelines. Even if you're not using design patterns or even coding > outside the IDE, you don't need to use root. For events you still need an object to dispatch them on. And it really is just used as window dressing to make people feel good about that same old code being "better". This is not the only use, but it is one thing that people keep doing. Events are worse than just calling the right method to begin with. Events are too loosely coupled if you ask me. If I get the event source wrong, there is no error raised and so on. Event listeners also can not return any value. Does this mean that I recommend people to stay away from events? No. I only want people to think before using them. Good things can be abused too. Or we could just cut out all this theorist cruff and focus on the issue at hand. How would you replace the root property? I say that there is a limit to how overly complicated you want to make your program. Most people are not hired to design virtual machines that "other people" program for, they are hired to actually do the boring work. My point here is that in reality, you can't be perfect or an elitist. Think about your goal before you overdo stuff. It is ok to not do stuff the absolutely cleanest possible way, it's total disasters that you should avoid. _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

