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.

11

u/twoy519 Nov 05 '20

I was actually speaking with one of my friends in the engineering org of my company about this recently. He sent me the following list of books:

  1. The Pragmatic Programmer

  2. Test Driven Development – by Example – Kent Beck

  3. Refactoring: Improving the Design of Existing Code - Martin Fowler

  4. Growing Object-Oriented Software, Guided by Tests – Freeman and Pryce

  5. Working Effectively with Legacy Code - Michael Feathers

  6. Agile Principles, Patterns, and Practices - Robert C. Martin

  7. Refactoring to Patterns - Joshua Kerievsky

  8. Domain-driven Design: Tackling Complexity in the Heart of Software - Eric Evans

1

u/Malassi Nov 05 '20

I haven't red all of them by yes they are good books. Some may be to advance for a beginner but they are still worth the read for sure.