Archive

Posts Tagged ‘inheritance’

JavaScript Prototypes and Inheritance

December 20th, 2010 3 comments

Someone on Hacker News asked for a concise description of “prototype” in JavaScript. I gave it a go, but the topic closed before I could post. So I saved it here for posterity.

And then I blew it out and made it considerable less concise, which might or might not be for the best, but you can be the judge of that.

Prototype-based inheritance in JavaScript can be a little bit strange to people accustomed to class-based inheritance, but it really doesn’t need to be difficult to grok. Like so many things, once you “get it”, it seems easy enough.
Read more…

Share

Object-Oriented Thinking Part Two

January 22nd, 2010 2 comments

(See “Object-Oriented Thinking, Part One“, if you haven’t done so already.)

In an earlier article, I talked a bit about how to get started with Object Oriented Programming (OOP), and I presented some information about encapsulation.

But this time we’re going to go a step further and talk about another major cornerstone of OOP: inheritance.

Read more…

Share