Clearing up confusing terminology — RexDac Academy

RexDac AcademyTechnical notes · Some prior knowledge helps
0%Published notes read · this device

Level 4 — Classes

Clearing up confusing terminology

Original notes by SunDiaL · View English source

This is where the terminology starts getting confusing, because everyone mixes and matches the words "object", "class", "instance"... and maybe others... because using one instead of the other often just sounds more natural when talking. To explain things a bit, let's take a step back and use a real-life example.

Think of making toy apples out of clay:

  • The class is like the mold you use to make toy apples. It defines what a toy apple should look like — the shape, size, and general structure. You don't have a toy apple yet, but you know what one will look like when you use the mold.
  • The object is a toy apple you made using the mold.
    It's a real, physical thing now. You can touch it, paint it, smash it — it exists.
    You can make lots of them, and each one might be slightly different — maybe a little more red, or slightly deformed — but they're all toy apples.
  • An instance is just a fancier way to say one of those toy apples. It's still a physical thing. The only difference is that the emphasis is put on the mold (class) that it came from.

In code terms:

Once you get this, the confusion mostly disappears — there are really just two things people might be talking about:

  1. The class itself
    a. "The Apple class defines the color and size."
    b. "The Apple type is used in recipes."
  2. A real object made from the class
    a. "I have a toy apple."
    b. "I have an object of type Apple."
    c. "I have an instance of Apple."

So if you're ever unsure what someone means, just ask: Are we talking about the mold (class)? Or a toy apple (object/instance)?