Slide 17
Slide 17 text
"Object"
Unnecessary:
10
Sunday, April 25, 2010
So what did we leave out?
You don't need classes for OOP. For example, Javascript. Though it has classes, they're kind of a
pain. Javascript programmers seem happier to forsake class-based OOP for prototype-based OOP.
You also don't need inheritance. I looked into it, the only existent OOP language that lacked
inheritance is early versions of Visual Basic. Inheritance is useful for structuring medium and large
programs, for sure, but I could easily envision a modern OOP language without inheritance. We'll
talk more about what kind of design it might use.
Finally you also don't need polymorphism, which lets an object act in place of another as long as it
is sufficiently similar. There are various ways to do this, such as duck typing, interfaces, and roles.
We'll be talking a lot about these today. They're all certainly useful, don't get me wrong, but it is
useful to examine what we stand to gain by stretching them or even ignoring them entirely.