3 ms·
Thanks, but no thanks. Prototypal inheritance is JavaScript's strength.
by cloudhead 17y ago
Thanks, but no thanks. Prototypal inheritance is JavaScript's strength.
- sreque 17y agoYou can do prototype-style inheritance in ruby, but no one does it. In fact, most new languages that come out express no interest in this style. It makes me wonder why the Javascript people are so convinced that why they have is that good.
- invisible 17y agoI don't know - I love PHP classes but I'd love to see PHP with prototype-style inheritance (if PHP had classes for strings, etc. in respect to basic variable types). I think the "everything is an object" route is great and coupling that with prototypes exemplifies that decision's greatness. However, I really do think that JavaScript needs all of the great things ECMA 5 displays first and foremost (such as strict mode, getters/setters/enumerable/configurable/writable for property descriptors). John Resig does an excellent job of summing up ECMA 5 pragmatically (it truly must be great to work on JavaScript stuff as a day job): http://ejohn.org/blog/ecmascript-5-objects-and-properties/ http://ejohn.org/blog/ecmascript-5-objects-and-properties/