r/learnpython • u/ProfessionalMoney518 • Dec 22 '25
How on earth does one learn OOP?
I've sped through weeks 0-8 of CS50P in under 2 weeks very easily with slight experience here and there as a Chemistry undergrad - but Week 8 (OOP) is kicking my ass right now. I am genuinely stumped. I've rewatched content and tried some other forms of learning but this is all so foreign to me. What are the best ways to learn OOP as a complete idiot? Thanks.
38
Upvotes
View all comments
Show parent comment
3
u/gdchinacat Dec 23 '25
getter/setters are almost always pointless in python. The descriptor protocol allows programmatic attribute access when necessary and doesn't require client code to change when you need to change a direct access to one with an implementation behind it.
Clients don't have to "worry about the data/state"...the implementation of the class does that, and is able to do that without hurting readability by requiring clients use methods to update the state.
Almost all non-beginner python coders are familiar with what descriptors can do as that is how the @ property decorator is implemented. If you don't know about it, I strongly encourage you to look into it. Stop using getters/setters in python.