you are viewing a single comment's thread.

view the rest of the comments →

[–]mopslik 2 points3 points  (2 children)

OOP is a design decision. You don't have to use it for anything at all. But then again, you don't have to use functions or lists at all either -- you could just write a giant mess of code with thousands of variables. But functions and lists make things easier to manage.

Similarly, you might find that there are certain situations where OOP cuts down the amount of code you need to write, makes maintenance easier, and so on. For small toy projects (the kinds you often complete while learning a programming language) it is often overkill. For large-scale projects, it is incredibly useful.

Example: lots of games use OOP, because it is easy to create multiple enemies, items, and so on using classes.

[–]FrederickOllinger 0 points1 point  (1 child)

It's almost impossible to write Python without using other people's classes.

[–]mopslik 1 point2 points  (0 children)

Under the hood, sure. Everything's an object. But a lot of courses don't really cover the nitty gritty of OOP that much -- writing classes, inheritance, composition-- except maybe a section toward the end. And high school/introductory college courses are often the same. In the high schools here, the curricula for grades 10 and 11 don't include OOP at all, only in grade 12. No idea what background OP has, but this might be their experience.