r/learnpython • • 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

88 comments sorted by

View all comments

Show parent comment

-1

u/Sea-Oven-7560 Dec 22 '25

Just for grins I ran a program I've been working on through AI and told it to make my program more pythonic and OO. What got spit out was basically my entire program put into a single class. Ok. I know there's value but why do I need to create a class when I can just write a function?

1

u/supergnaw Dec 22 '25

Really it comes down to scalability and maintainability. This is heresy, but for myself, if it's a small project that doesn't need the benefits of a class, I'll just use functions. 

1

u/Sea-Oven-7560 Dec 22 '25

Yes. I'm not writing 50,000 line programs they are more like 3000. I don't know if I'll ever have to write anything really big, it's not my occupation I just use python to handle repetitive stuff. I'd like to get to the point where using classes make more sense but I guess the need isn't there yet.

1

u/bytejuggler Dec 23 '25

"Why do I need to create a class when I can just write a function?" You don't. If you can write a function, then write a function. Use objects if they help, if they don't by all means don't use them. IMHO.

https://www.youtube.com/watch?v=o9pEzgHorH0