this post was submitted on 25 Jun 2025
26 points (90.6% liked)

Python

7256 readers
1 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
 

This is a question for people more experienced with Python, but everybody feel free to answer if you feel like you can provide something decent to the discussion.

Also feel free to explain why you feel that way and your experiences with Python and the paradigms.

you are viewing a single comment's thread
view the rest of the comments
[–] Diplomjodler3@lemmy.world 19 points 6 days ago (7 children)

I used to struggle with OOP because all the explanations I saw were in terms of metaphors of real world objects. Once i started seeing OOP as a way to better structure your code, it all fell into place. If you do anything marginally complex, OO is the way to go.

[–] FizzyOrange@programming.dev 1 points 6 days ago (2 children)

I disagree. You can write a lot of high quality Python code (yeah it exists) before you need to use inheritance. If you're reaching for inheritance as the solution to all complexity, GoF-style, then you're doing it wrong.

It's an occasionally useful tool that has its place, not something you should instinctively reach for.

[–] Sleepkever@lemm.ee 4 points 6 days ago

OOP not just inheritance. Object oriented programming starts with structuring things in objects, like the name suggests. It quickly has a place in anything more then a few hundred lines of code.

[–] Diplomjodler3@lemmy.world 3 points 5 days ago (1 children)

I rarely use inheritance. Like i said, I see OOP mainly as a way to achieve cleaner code structure and better readability. That last point is really my main concern.

Ah yeah I agree. Misread your comment.

load more comments (4 replies)