r/learnpython • • Nov 05 '20

How does one learn to make well-structured programs? Mine are dumpster-fires.

So I just (kind-of) finished reading Automate The Boring Stuff With Python, and for the past month I've felt like a big-brained super-hero automating myself out of a job (Data Analyst).

The problem is, I feel I missing something along the way. I don't understand the proper way to use functions, what a class is, why people have multiple files in a program, how/why people use GitHub...probably some other things I haven't discovered yet.

They all seem to be related to organization? Is there a "How To Structure Your Python Stuff With Python" book?

478 Upvotes

98 comments sorted by

View all comments

1

u/Sigg3net Nov 05 '20

You're looking for design patterns.

Object oriented design patterns are meta structures tested by time. If you know patterns, you can understand languages you haven't learned yet. (I recently watched a two hour video about patterns and it was all in java, which I don't know.)

From what little I've gathered, the structural patterns are the mist useful for python. (And the Borg pattern was designed for python.)

Check out https://python-3-patterns-idioms-test.readthedocs.io/