Comment

Comment by harrelchris

Either keep looking for explanations until it clicks, or try to break it down into more fundamental elements.

Classes and blueprints have a simple analogy that I'm sure you are familiar with.

Blueprints are instructions for how to build something, like a house. Once built, the house is a physical thing you can interact with. It has attributes, such as a height or color. It has things it can do or that can be done to it, like open a door or turn on some lights.

Classes are blueprints - they tell a computer how to build something. An object is what is built by the class - it has attributes and methods.

parent harrelchris 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton