2008/10/24 Anthony Ziebell <[EMAIL PROTECTED]>: > Forgot to clarify one thing: ECMAScript is fully OO in my opinion, however > JavaScript is not a full implementation of ECMAScript, unfortunately.
JavaScript is a superset of ECMAScript. If ECMAScript is opbject oriented, so is JavaScript. As I mentioned, classes are not necessary or even important for a language to be object oriented. Prototypal delegation is just one of several methods of implementing inheritance in an object oriented language. It doesn't make the language any less object oriented. Please go have a read through this:<uri:http://www.paulgraham.com/reesoo.html> JavaScript fulfills plenty of them. 2008/10/24 Brett Patterson <[EMAIL PROTECTED]>: > Well, I read http://en.wikipedia.org/wiki/Prototype-based_programming and > http://en.wikipedia.org/wiki/Object-based_languages , and I see your points. > But, for arguments sake, let's say it is not prototype-based. Would it be > object-oriented, like Java or C++, or object-based? Depends on what definition you use for either of those terms. Object orientation? Java and C++ fail to live up to some of the possible criteria for a language being object oriented. Object based? Do you mean that every value is an object? If so, JavaScript is that. Do you mean that it uses prototypal inheritance? Then it is that. Do you mean it has a limited form of object orientation without inheritance or polymorphism? If so it is not, because it has those features. > I read these as well: > > http://en.wikipedia.org/wiki/Object-based > > and > > http://en.wikipedia.org/wiki/Category:Object-based_programming_languages > > What's worst is is that now I am confused. This seems too contradictory, > based on the articles linked. That's because the definitions are fuzzy and broad. A language is better described by what type of programming it facilitates than by what it can be considered to be, anyway. JavaScript uses prototype delegation. That means that properties are looked up in the object itself, and then in the prototype of the object, and so on untill the top of the prototype chain has been reached. It's a mode of direct implementation-to-implementation inheritance. Classical inheritance on the other hand sets up a chain or tree of classes, and objects are instances of those classes. In other words objects do not inherit directly from other objects but rather from this chain or tree of classes - a template chain if you want, though in some of these langauges the word template means something different. These languages typically also have a type-to-class correspondence and a deep type hierarchy system. Some have a separate interface scheme that is about object and function signatures connected with the type system but that does not allow code inheritance. Some have only this and no implementation inheritance mechanism. -- David "liorean" Andersson ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *******************************************************************
