Search code examples
terminologysupercollider

Difference between "type", "instance", "class" and "object" concepts


I am trying to understand the concept of classes and objects, and I came across to the words "type" and "instance". Does type mean exactly the same thing as class, and instance for object? Or is there a difference in between, such as a usage difference etc.?


Solution

  • Quick Example

    A class is the design specs for a MacbookPro, an instance is your MacbookPro specifically.

    A type is just a class that defines your class, so that we can look at a blueprint and ask if design spec is MacbookProBlueprint. This is useful when we want meta-data about our classes (or other types). Think of a type as an Amazon.com entry, that would have lots of information about the MacbookPro such as processor speed and capabilities but not enough to actually build the object.

    An object is your MacbookPro, or my car, or anything. Everything is an object which has implications larger than the scope of this question, but is fundamental nonetheless.