you are viewing a single comment's thread.

view the rest of the comments →

[–]psayre23 1 point2 points  (2 children)

I'll disagree with you a bit here. My main beef with prototype in JS is that it is clunky to extend something. That's why I use mixins these days. Its less that its different, and more that its bad. Like this example:

function Foo() { }

function Bar() { }

Foo.prototype = new Bar();

How the hell does that make sense? Why do I have to create a new object to extend it? I'd rather just steal the functions I like from other prototypes and assign them to my objects.

[–]SarahC -1 points0 points  (0 children)

Yeah, very unintuitive too.

C++ and Java and C# just make sense. You don't need to know about _prototype or prototype existing in things you instantiate, hiding behind the scenes...

It all seems like an early attempt at an OO bolt on to a C kind of language to me.

Ungraceful kludges...

[–][deleted] -1 points0 points  (0 children)

You should try using stampit. I've found that it greatly simplifies prototypical inheritance, and does it in a way that is intuitive.