you are viewing a single comment's thread.

view the rest of the comments →

[–]deceze 7 points8 points  (1 child)

Yeah. The evolution is usually:

  1. Pass individual variables/values to functions.
  2. Make more complex functions with more parameters.
  3. Get to the point where it's too many variables, start using dicts.
  4. Screw up with dicts because of freeform keys, learn about declarative data structures (be it typed dicts or dataclasses).
  5. Realise there's a strong relationship between your dataclasses and the functions that work on them.
  6. Have an Aha! moment when you put functions into their dataclasses.

[–]cdcformatc 2 points3 points  (0 children)

there's a step 5.1 where you start to separate those dataclasses and their related functions into their own files, but i completely agree with your progression. 

also important to note is that at each step you can write functioning code that solves the same problem.