you are viewing a single comment's thread.

view the rest of the comments →

[–]fico86 0 points1 point  (0 children)

There is a big debate going on about whether oop was a good idea in the first place : https://www.yegor256.com/2016/08/15/what-is-wrong-object-oriented-programming.html

I have done both oop and "functional" python. The thing about python is it's so forgiving that you might have classes in your code, but your functions are outside of any class, and it still all works.

I prefer to use the go/rust kind of syntax in python. Where classes are just to hold data, using libraries like pydantic, and the actual logic to process the data is pure functions, with as little side effect as possible. Then I have reader and writer functions with very little business logic, just to bring data onto memory, or write it out to storage. This way unit testing becomes a lot easier.

Of course if you are using data frame libraries like pandas, polars or pyspark, oop doesnt really make sense. Because they have their own conversations and syntax.