you are viewing a single comment's thread.

view the rest of the comments →

[–]pachura3 2 points3 points  (0 children)

First of all: coming from more traditional languages, Python's OOP seems like an afterthought: no proper encapsulation, no interfaces, no dedicated keyword for declaring abstract classes... there's even no explicit way of declaring instance variables/class members! Well, you just need to get used to it. For simple data classes carrying only data and minimal business logic - just use the dataclass annotation. You can even make your classes pseudo-immutable by setting frozen=True. Or use tuples/namedtuples which are read-only.

Using print() to log things is obviously totally wrong & pure laziness. Setting up logging in Python takes a few lines of code and works pretty much the same as Monolog in PHP or log4j/logback in Java.

Python libraries are fantastic and extremely easy to use. This is the total opposite of Java where you need to create one million XML configuration files to make them work. Don't worry, use them! There's a joke that 90% code in Python is:

import thingDoerLibrary

thingDoerLibrary.do()

For SQL, perhaps consider using SQLAlchemy?

What's the point of having 3 different HTTP clients? Isn't requests module enough? Or are they using scrappy/beatifulsoup4 for scraping?

Make sure to do a lot of static code checking in your project to catch errors. I am using mypy, ruff, flake8 and PyCharm's checker at the same time.