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

58

u/Malassi Nov 05 '20 edited Nov 05 '20

There are 2 good book you could look into but they don't use python but it doesn't really matter since it's not about the language but rather how to write good code and write good architecture.

  1. Clean code

  2. Clean architecture

They are two really good book. The first is about writing better code and the second about how to write a better architecture.

About git. Git is a versioning software. In other word it helps to keep versions of you code, work with other without having conflicts and loads more. It's essential to know how to work with git.

If you want to make your architecture better without reading a entire book about it, check design patterns. Same for classes you can see how do they work here's a tutorial that may help (there's a load more on the internet).

Hope it helps. Have a good day.

Ps. If you want you could share a project and I could check it out and see what you could do to make it better.

13

u/arjo_reich Nov 05 '20

I think Clean Code is great recommendation. Covers programming by "side effect" in a language agnostic manner.

4

u/Malassi Nov 05 '20

Indeed and if you haven't read Clean Architecture you would love it. It's also written by Uncle bob and it's really useful.