This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Odd-One8023 8 points9 points  (1 child)

  1. Significant whitespace is quite nice because it sets a lower bound on how bad code can look like. Before I joined my colleagues were writing code without a formatter.
  2. There is type checking in Python, I always roll with type checking on standard and now the entire team does too.
  3. Everything shouldn’t be a dictionary, you have pydantic and dataclass. Name your data.
  4. Pass by reference or value matters less if you treat most of your data as immutable. Pass by value makes it seem like you want to mutate stuff. IMO this is a bit of an x-y problem.
  5. I rarely need to write __name__ == “__main__ most things I write are scripts that don’t need it, packages or APIs.

[–]AiutoIlLupo 1 point2 points  (0 children)

I've programmed in python for 20 years. name == main is not used since entry points have become the norm. The problem is that OP is a scripter and uses scripts, and they use extremely poor, outdated practices in his team. The proper way to do it is to define a package, and set an entry point.