“Classes vs. Prototypes – Some Philosophical and Historical Observations”

Thanks to Roberto Guerra on the Objects on Rails mailing list for making me aware of this fascinating paper:

The distinction between class-based and prototype-based systems reflects a long-lasting philosophical dispute concerning the representation of abstractions. Plato viewed forms — stable, abstract, “ideal” descriptions of things — as having an existence more real than instances of those things in the real world. Class-based languages such as Smalltalk, C++ or Simula are Platonic in their explicit use of classes to represent similarity among collections of objects. Prototype-based systems such as Self [UnS87], Omega [Bla91, Bla94], Kevo [Tai92, Tai93], GlyphicScript [Gly94] and NewtonScript [SLS94] represent another view of the world, in which one does not rely so much on advance categorization and classification, but rather tries to make the concepts in the problem domain as tangible and intuitive as possible. A typical argument in favor of prototypes is that people seem to be a lot better at dealing with specific examples first, then generalizing from them, than they are at absorbing general abstract principles first and later applying them in particular cases.

Prototypes give rise to a broad spectrum of interesting technical, conceptual and philosophical issues. In this paper we take a rather unusual, non-technical approach and investigate object-oriented programming and the prototype-based programming field from a purely philosophical viewpoint. Some historical facts and observations pertaining to objects and prototypes are presented, and conclusions based on those observations are derived.

The whole thing is very much worth reading (click the tiny PDF icon); I found the description of the Kevo language at the end particularly interesting.

7 comments

  1. Interesting find. However, I looked up how Kevo has fared, and it seems to have gone nowhere. Meanwhile, I believe that the analogy between computational artifacts and real world classification to be misleading. The real world is in some sense given to us as is, and what we do is model it however we deem best. But in the classical Turing computational world, nothing is given, and we create everything from atoms. A bit is a bit, a register is a register, and bottom up we have to account for everything precisely. There are no fuzzy “family resemblances” in processes running on our computers.

    1. Kevo didn’t fare well, but there is One language that has: Javascript. Much of the bad rap it receives is from us coming from ‘Classical’ OO languages not able to adapt to the concept of Protoypes. It is also one of the reasons many Javascript devs abhor all these attempts to ‘Classify’ Javascript (TypeScript, Dart, GWT, CoffeeScript, et al).

      1. That JavaScript rejects classes (and you are right, wrapper languages around it only “fake” them) is definitely interesting, but I’m not sure because of the presence of prototypes. Rather, as far as I can tell, the most interesting thing about JavaScript is the functional part, from its heritage as inspired by Scheme.

    2. Oh, also, when you look at the concept of DCI (http://www.artima.com/articles/dci_vision.html) is really an attempt to simulate Prototypes in Classy languages. There are benefits to this. However, to be honest, it is awkward at the moment because the languages don’t allow us to do this. I do hope we see some advancements in this area. I think it will put more focus on behaviour instead of classes (as it rightly should).

      1. Classes are not very interesting to me at all, actually. I come from a background in functional, not object-oriented programming. So for me, abstraction and behavior are most interesting, yes. That modern OO languages have started moving away from classes toward interfaces and traits is a good thing.

        1. Traits still don’t give us what prototypes do, yet. In Scala they can only be used when an object is instantiated. With prototypes, you can modify behaviour of an object at any time. Not really sure what other language allows us to do this without jumping through hoops(monkey patching is not a valid solution I think).

Leave a Reply to Roberto Guerra Cancel reply

Your email address will not be published. Required fields are marked *