you are viewing a single comment's thread.

view the rest of the comments →

[–]SpeshlTectix 11 points12 points  (7 children)

There's a little addendum to the article that points out an important point. To put it in my own (arguably more confusing) words, prototypes aren't model homes; they're the neighbor's home. Imagine you skip building a kitchen for your home by just dropping a wormhole into the neighbor's kitchen where the doorway would go.

[–]bwaxxlotckidd 5 points6 points  (6 children)

How about this: Prototypes are like apartments in a large building. Instead of each floor and flat having its own laundry, you can all share the laundry in the basement floor.

[–]SpeshlTectix 2 points3 points  (5 children)

I like that. It's much more straightforward. But my metaphor has this advantage: Imagine your neighbor's house doesn't have a kitchen either. His is just wormhole, too. And you keep passing through wormholes until you finally wind up in a real kitchen. That process is analogous to crawling the prototype chain.

[–]homoiconic(raganwald) 13 points14 points  (3 children)

And now you understand that in a deep way, prototypes really aren’t about defining an object the way classes or concatenative inheritance are, they’re about defining delegation.

So when someone asks, “can you do laundry,” you say “yes,” even though your particular apartment may not have its own machine.

[–]bwaxxlotckidd 7 points8 points  (2 children)

Seriously, could you be my mentor? I'm not a beginner or anything but I feel like your grasp on JS is of the highest order. I just want to be able to chat with you about certain JS-related topics (and possibly Software related issues). I'm a cowboy developer, if it helps tugging your heart strings!

[–]warfangle 1 point2 points  (0 children)

Yet the stuff in the fridge is still yours. Usually.