Quiz

  1. Can you go over the order in which class is created, then methods, then instances? I'm a little unclear on how the different pieces connect.

    For sure. The modern JavaScript syntax defines the class and methods all at once, so that's a single step.

    Once that's defined, other parts of the program can create instances of the class and use them in the program execution. That is, creating and using objects happens after all the parts (functions, classes) are defined.

    In relatively static languages like Java, all the definitions happen first (during compilation when .java files are turned into .class files), and the run-time comes after.

    JavaScript can be more dynamic than that, though in practice it often works similarly.

    Coffeerun is like that, and we will be using JS in the static mode: define first, executesecond.

  2. Would prefabs in video game development be like just prototypes with extra steps?

    Interesting!

    In video game development, a prefab (short for prefabricated object) is a reusable game object template that you can place into a scene multiple times. Think of it as a saved blueprint of an object that includes its components, properties, and sometimes child objects.

    So, yes, I think there's a lot in common between the two ideas.

    In the case of OOP, the prototypes holds the methods and other properties shared by all the objects of a particular class.

  3. Can you talk more about what exactly is an API? / Can you talk more about API? I did't see it in the reading.

    Good question. I should discuss APIs more in the reading.

    I've just added API. Let's look at it together.

    It looks like I should discard that question. I'll ask LTS about how to do that.