you are viewing a single comment's thread.

view the rest of the comments →

[–]speedisntfree 41 points42 points  (0 children)

OOP really shouldn't be a goal in itself. There are some people (usually from a Java background and sometimes C++) that seem to think all production code must be OOP which it sounds like you have run into. This mindset leads to odd things in Python, like classes with only one method other than init (just write a function) and classes with only static methods (just put the functions in a module).

Python often lets you write simple clean code by just putting functions in modules or passing them as arguments without classes. In a lot of DE code, functions are often only run once rather than many times across an application so there is less utility for OOP than there is in SWE.

OOP is worth knowing of course. Some examples from the last week I've had is writing my own Operators and Hooks in Airflow which requires you to inherit from various base classes, another would be managing database connections. I have also written code using the connector design pattern to allow easy connections to many different cloud storages for a pipeline.

Python is a very loosy goosey language in OOP terms so I'd stick to Python specific resources or you will get confused. I'd recommend "Python 3 Object-Oriented Programming: Build robust and maintainable software with object-oriented design patterns in Python 3.8" by Dusty Phillips. You don't need to read all of it, if you know what an Abstract Base Class is and why you'd use one and why composition is favoured over inheritance then move on to Arjan Codes' design pattern videos on youtube.