JavaScript is not a class based language and I think it is a mistake to try to 
hard to make it act like one. Many have tried this - and failed.

I think we should focus some more on what it is we want to be able to do and 
not trying to make JavaScript into something it isn't.

One of the reasons I love Prototype is because it utilises the strengths of the 
I don't want a lot of new 'magic' ways of doing stuff that is already possible 
pretty clean ways.

Just my 2 cents -- since I felt this discussion was heading in a 'lets make JS 
more like Java/C++/etc. (or even Ruby)' :)


-----Oprindelig meddelelse-----
Fra: [mailto:[EMAIL PROTECTED] På vegne af 
Andrew Dupont
Sendt: 23. juni 2007 22:02
Til: Prototype: Core
Emne: [Prototype-core] Inheritance: your thoughts?

We've been working on a more robust class-based inheritance model,
fashioned after Dean Edwards's Base and others like it. There's an
inheritance branch in the SVN repository that shows our latest

We've had some lively internal discussions about syntax. I figured I'd
hold my finger to the wind and see how the list feels about some of
these issues.

First, go to <
branches/inheritance/test/unit/base.html> and take a look at the
handful of unit tests we've written for inheritance. The fixtures
start at line 60 (Animal, Cat, Mouse) and the tests start at line 315.

Next, consider these questions:

  1. Does the current API make sense? Was there anything about it that
surprised you? Anything you'd add or remove?
  2. Does "this.parent()" make sense as a way of calling the
superclass's method? (We can't use the word "super" because it's
reserved in JavaScript).
  3. Right now there are a few "magic" properties in class instances:
"superclass," "subclasses," and "parent." Is this too much magic? Not
enough magic? Do you think these are likely enough to conflict with
existing properties of a class that it's worth namespacing them
somehow? ($superclass, $subclasses, $parent, etc.)

Feel free to make feature requests or ask other questions. Kudos to
Alex Arnell's inheritance scheme <
inheritance/> for getting all of this started.


You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to