// blog

Articles

// Object-oriented programming
Reusing Code with Inheritance

The problem...
You have an Animal class. It works well for the Safe Paws shelter — name, species, size, health, status.
Now you want a Dog class and a Cat class. Dogs have…

16 May 2026 3 min read files [1] comments [0] 30 views
// Object-oriented programming
Polymorphism: When the Same Call Does Different Things

The problem...
You have a list of animals — dogs, cats, maybe other species. You want to call describe() on each one. But Dog.describe() and Cat.describe() produce differen…

16 May 2026 2 min read files [1] comments [0] 32 views
// Object-oriented programming
Making Objects Behave Like Built-ins

The problem...
You have an Animal object. You print it:
lassie = Animal("Lassie", "dog", 4)
print(lassie)
Output → <__main__.Animal object at 0x10b3c2d50>
A memory…

16 May 2026 2 min read files [1] comments [0] 28 views
// Object-oriented programming
Calories Tracker Update — Round 1/2

You've built the Calories Tracker. It works. It persists. It reports.
Now we rebuild it — not because it's broken, but because we can do better. And because seeing the same…

18 May 2026 3 min read files [0] comments [0] 29 views
// Object-oriented programming
Calories Tracker Update — Round 2/2

The class has a constructor, a load method, and an add method. Time to complete it — reports, export, and menu.
The mapping from Round 1 holds. Every function becomes a met…

18 May 2026 3 min read files [1] comments [0] 31 views
// Object-oriented programming
Safe Paws Update — Round 1/2

We rebuilt the Calories Tracker as a class. Now we do the same for Safe Paws — but this time we go further.
The Calories Tracker had one class. Safe Paws gets two.
Why two…

18 May 2026 4 min read files [0] comments [0] 31 views