The answer is quite simple: because it's convenient.

Convenience is an interesting thing. You seem to be a logical type,
postulating that "there must be something beyond just convenience here,"
because if it can be done without this construct, why add the construct,
right? That takes the human part of the equation right of the picture
though. The truth is that humans, even programmers, are irrational. We
sometimes do things just because, or barring that, just because it achieves
a certain stylistic property that pleases us.

In this case, I think it's both "just because" and "because it's pretty". At
a minimum, it's convenient.




On Fri, Mar 18, 2011 at 8:13 AM, Luke <kickingje...@gmail.com> wrote:

> I'm sorry, what I meant was this.superclass In Prototype's class
> implementation you can see that if you provide a parent-class in prototype's
> Class.Create-Method, that class will be referenced as superclass in the
> class you are creating:
>
>   function create() {
>     var parent = null, properties = $A(arguments);
>     if (Object.isFunction(properties[0]))
>       parent = properties.shift();
>
>     // ...
>
>
>     klass.superclass = parent;
>
>     // ...
>
>     return klass;
>   }
>
>
> why not just use this.superclass.method in the subclass?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to