# Why do I delegate when I can apply?

**URL:** https://forum.kirupa.com/t/why-do-i-delegate-when-i-can-apply/216475
**Category:** flash
**Created:** [February 16, 2007, 9:35pm UTC](https://forum.kirupa.com/t/why-do-i-delegate-when-i-can-apply/216475 "2007-02-16T21:35:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Whaka](https://avatars.discourse-cdn.com/v4/letter/w/df788c/32.png) [@Whaka](https://forum.kirupa.com/u/Whaka)
#### Post date: [February 16, 2007, 9:35pm UTC](https://forum.kirupa.com/t/why-do-i-delegate-when-i-can-apply/216475/1 "2007-02-16T21:35:52Z")

</div>

What is the advantage of using a Delegate class in as2? I realize that it’s old news for as3 guys. But Ive got a medium sized as2 project and Im going through my code and wondering why Im using Delegate.create sometimes. What’s wrong with “apply”?

I admit that I must have jumped on the Delegate bandwagon without thinking anything more than “dhuu…thats what the pros must be using”.

Am I right in saying that there is nothing at all wrong with simply saying “function\_name.apply( this, args )”? Or am I missing something? Is it a matter of memory management? I’ve done a lot of research on delegation and read all kinds of blogs and scripts from little tweeks to the official… to \>200 lines. Yikes! At the end of the day I wrote my own little delegate class that worked for me (just a rewrite of Proxy without loops). But now that I go though my code I see that I might as well have just used apply because that’s all Im doing with it!

Id like to be a better programmer. What am I missing and why shouldn’t I do a find and replace here. Why is it better to wrap up “apply”? Will I be better readied to learn other languages? If thats it Im all for it. Could you tell me why?

I just don’t understand why I was so convinced that I needed the delegate class when I had “apply” out of the box.

Thanks and I hope I didnt take up too much space here.
