Introduction to Coding: What Are Objects?
Hey there, young coders! Today we’re going to learn about one of the most useful ideas in programming: objects. Once you understand objects, you’ll start seeing them everywhere: in games, in apps, and even in the world around you!
What is an object?
An object is a way for a program to describe one thing. That thing has information about itself (what it’s like) and things it can do.
Think about a toy car. If you wanted to describe it to a friend, you might say:
- It’s red.
- It’s going fast.
- It’s at the start of the race track.
And you might say what it can do:
- It can move forward.
- It can honk its horn.
In code, we describe things the same way. An object bundles together what something is like y what it can do.
Properties: what an object is like
The information an object stores is called its properties. Each property has a name and a value:
| Property name | Value |
|---|---|
| color | red |
| speed | 5 |
| position | 0 |
You get to decide which properties an object needs. A toy car needs a color and a speed. A game score doesn’t need a color at all, just a number!
Methods: what an object can do
The actions an object can do are called methods. Our car might have:
move()to drive forwardhonk()to beep its horn
Here’s the really cool part: methods can change properties. When the car moves, its position changes. That’s why we keep properties and methods together in one object, because they work as a team.
What does it look like in code?
In many programming languages, we use a dot (.) to talk to an object:
Python
my_car.color = "red" # set a property
my_car.move(10) # call a method: drive 10 steps
print(my_car.position) # the position is now 10!
Read the dot like the word “‘s”: “my car’s color is red,” “my car, move 10.”
One blueprint, many objects
What if your game needs 20 race cars? Writing the same code 20 times would be a lot of work! Instead, programmers make a class, which is a blueprint for an object.
A class is like a cookie cutter. You design the cutter once, and then you can make as many cookies as you want. Each cookie has the same shape, but you can decorate them differently. In the same way, one Car class can make a red car, a blue car, and a green car, each with its own properties.
That’s how objects help us reuse code: write the blueprint once, use it again and again.
Objects don’t have to be real things
Objects can describe things you can’t touch, too:
- UNA puntaje object that stores points and has a method to add more
- UNA timer object that counts down and has a method to start
- UNA jugador object with a name, a number of lives, and a method to jump
Try it yourself!
Pick your favorite animal or pet. On a piece of paper, make two lists:
- Properties: three things that describe it (with values!), like
name = "Max"olegs = 4. - Methods: three things it can do, like
bark()osleep().
Bonus challenge: for each method, write down which property it changes. Does eat() change hunger?
Congratulations, you just designed your first object!
Let’s keep learning!
Now you know that an object bundles information and actions together, that properties have names and values, that methods can change properties, and that classes let us build many objects from one blueprint. Next time, we’ll explore another important coding idea. See you then, coders!here we’ll learn about another exciting coding term. Ready to code some magic? Let’s go!


