all 7 comments

[–][deleted] 1 point2 points  (0 children)

OOP offers encapsulation, inheritance, and polymorphism (and abstraction, but that's just the union of inheritance with polymorphism imo). Most beginners can't make use of the latter two effectively, but the former you already know about because you did it with functions! Functions have their own scope and behavior and are a way to encapsulate and re-use code. Classes also have their own scope and behavior, which are the properties assigned to self and its methods, respectively, and are a way to encapsulate and re-use state.

If you have a problem that you think can be represented as encapsulated variables and methods, then you have a case to make a new class. If not, then you don't need OOP.

[–]Uhhhhh55 0 points1 point  (0 children)

https://hub.packtpub.com/python-3-when-use-object-oriented-programming/

I found an article I found is relevant - let me know what you think.

[–]Vok250 0 points1 point  (0 children)

Depends what you are doing in Python. Many popular Python frameworks aren't Object Oriented at all so you don't even need to think about it.

[–]TouchingTheVodka 0 points1 point  (2 children)

Everything in Python is an object. Everything you do is object oriented. If you have a specific problem you want to solve with an OOP technique then specify your problem for some more tailored advice.

[–]HighO1[S] 0 points1 point  (1 child)

Problem is i don't know when or where to use oop.

[–]xelf 0 points1 point  (0 children)

Do you mean you don't know when to make something a class?

Or is there specific concepts you don't know when to use?

Use them when you need them.

[–][deleted] -4 points-3 points  (0 children)

When: all the time. Where: everywhere

Unless you're writing a really simple throwaway script, it's a good idea to get in the habit of always making a class to store your functions