r/learnpython • u/TheGrapez • 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
370
u/pbw Nov 05 '20
There is an art and science to programming that must be learned that’s totally independent of any specific language. It takes time and practice and study.
You need to develop an engineering aesthetic so when you look at code you immediately see how it could be improved. Then you need the skills to push it into that shape without breaking tests or functionality in general.
There are books you can read but it’s somewhat like reading a book on how to play basketball. It can give you ideas but you have to practice it yourself, figure out your own ways of looking at things and doing things.
In writing (English) they say everyone has 100,000 words of poor writing in them. So the best you can do is speed through that to get the good stuff.