• Home
  • Blog
  • Python
  • The “why” of object-oriented programming (in Python)

The “why” of object-oriented programming (in Python)

April 1, 2022 . By Reuven

When I ask people — in my corporate training, or when they join my “Better developers” newsletter — what frustrations they have with Python, many people say that it’s object-oriented programming. Even if they have a decent background in procedural (i.e., traditional, non-OO) development, objects confuse and surprise them.

That’s a shame, because the whole point of objects is to help us organize our code better, to make it easier to both develop and maintain programs.

A lot of introductions to objects focus on the “how,” talking about syntax — creating classes, defining methods, and the like. But I haven’t seen a lot of discussions of the “why,” or comparing how you would accomplish something without objects vs. how you would do so with them.

In this short (15-minute) video, I provide just this sort of introduction, using Python as the language. I first show how I can use tuples and functions to accomplish a simple task, and then show how you can use a class and methods to do the same thing. After watching this video, I hope that you’ll have a better sense of why and when we can use objects, and what advantages they can give us.

Questions or comments? Let me know here, on Twitter (@reuvenmlerner), or even via e-mail, at reuven@lerner.co.il.

Related Posts

Prepare yourself for a better career, with my new Python learning memberships

Prepare yourself for a better career, with my new Python learning memberships

I’m banned for life from advertising on Meta. Because I teach Python.

I’m banned for life from advertising on Meta. Because I teach Python.

Sharpen your Pandas skills with “Bamboo Weekly”

Sharpen your Pandas skills with “Bamboo Weekly”
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>