This is an AMP version of the article, its original content can be found here.

OOP Without Classes?

I interviewed David West, the author of the Object Thinking book, a few weeks ago, and he said that classes were not meant to be in object-oriented programming at all. He actually said that earlier; I just didn't understand him then. The more I've thought about this, the more it appears obvious that we indeed do not need classes.

Here is a prototype.

Let's say we have only types and objects. First, we define a type:

Then we create an object (pay attention; we don't "instantiate"):

Then we create another object, which will behave similarly to the one we already have but with different constructor arguments. We copy an existing one:

Libraries will deliver us objects, which we can copy.

That's it.

No implementation inheritance and no static methods, of course. Only subtyping.

Why not?