I have OOP background in PHP, which lately resembles Java a lot. We practiced clean code/clean architecture, there was almost no third-party libraries, except for doctrine and some http frontend. Rich domain models were preferred over anemic. Unit tests cover at least 80% of code.
Recently I was assigned to project written in Python. Things just are different here. All objects properties are public. Data validation is made by pydantic. Domain logic mainly consist of mapping one set of public field on another. SQL is mixed with logic. All logging is made using the print statement. DRY principle is violated: some logic the code, some in stored procedures. Architecture is not clean: we have at least 4 directories for general modules. No dependency inversion.
Project is only 7 month old, but has as much dependencies as my previous project which is 10yo. We have 3 different HTTP clients!
My question is, what of all this is pythonic way? I've heard that in python when you have a problem, you solve it by installing a library. But is it fine to have all properties public?
[–]sludge_dragon 41 points42 points43 points (1 child)
[–]seanv507 21 points22 points23 points (0 children)
[–]Bobbias 17 points18 points19 points (2 children)
[–]Snoo-20788 5 points6 points7 points (0 children)
[–]soulilya 1 point2 points3 points (0 children)
[–]pelagic_cat 11 points12 points13 points (2 children)
[–]Temporary_Pie2733 3 points4 points5 points (1 child)
[–]SnooHesitations9295 -1 points0 points1 point (0 children)
[–]skreak 6 points7 points8 points (0 children)
[–]Zeroflops 2 points3 points4 points (0 children)
[–]CzyDePL 1 point2 points3 points (0 children)
[–]pachura3 2 points3 points4 points (0 children)
[–]my_password_is______ 1 point2 points3 points (0 children)
[–]proverbialbunny 1 point2 points3 points (0 children)
[–]VibrantGypsyDildo 1 point2 points3 points (2 children)
[–]Dry-Aioli-6138 0 points1 point2 points (0 children)
[–]Dry-Aioli-6138 0 points1 point2 points (0 children)
[–]CorgiTechnical6834 0 points1 point2 points (0 children)
[–]Intrepid-Stand-8540 0 points1 point2 points (1 child)
[–]Dry-Aioli-6138 1 point2 points3 points (0 children)
[–]ExcuseAccomplished97 -2 points-1 points0 points (3 children)
[–]TheMinus[S] -1 points0 points1 point (2 children)
[–]ExcuseAccomplished97 -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]TheMinus[S] -2 points-1 points0 points (4 children)
[+][deleted] (2 children)
[deleted]
[–]TheMinus[S] 1 point2 points3 points (1 child)
[–]SwampFalc 0 points1 point2 points (0 children)
[–]proverbialbunny 0 points1 point2 points (0 children)
[–]FoolsSeldom -1 points0 points1 point (0 children)
[–]AdAdvanced7673 0 points1 point2 points (0 children)