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

14

u/arjo_reich Nov 05 '20 edited Nov 05 '20

You might want to branch out to C#, Java or C++ (in order of personal preference, nothing more) for more resources however that still kinda open ended...

You'll want to look into Functional Perishing to learn how to write functions without side effects and Domain Driven Design for how to representative object models.

Both are "deep water" topics so do not feel "too good for" overly simplistic primers on each for a while.

Edit: I do not ascribe to "programming is an art-form" rhetoric. It's a science, and as a science, there is always room to improve the process or the product. Thinking your code is art makes code reviews a PITA.

Edit 2: Functional Programming, not Perishing, silly autocorrect...

5

u/TheGrapez Nov 05 '20

I've been thinking about Java as my next adventure. I once attended a conference where an NBA team analyst spoke about how he used data science + java script to build really stunning visuals and allotted that to his early success.

I also took a few classes in C++ in school so am familiar with object oriented programming. Never kept it up though and did not do very well now that I think about it.

thank you :)

26

u/arjo_reich Nov 05 '20

Javascript is to Java what a Mars bar is to Mars.

8

u/TheGrapez Nov 05 '20

totally thought they were the same.

...mars like the planet, right?

9

u/arjo_reich Nov 05 '20

The first is a candy bar the other is a planet, the only thing similar is the first word. Java & Javascript should be considered similarly.

6

u/TheGrapez Nov 05 '20

interesting. I'll add this to my list of things to google today to avoid doing work.

Thank you for your help today - I was not expecting such a response.

4

u/[deleted] Nov 05 '20

There's also TypeScript, which is JS with some QoL improvements.

1

u/[deleted] Nov 06 '20

Forget about the java in javascript, it's most commonly referred to as JS nowadays anyway.

2

u/Doppelbockk Nov 05 '20

I am interested in reading more about Functional Perishing but my google fu is failing me today, can you provide an elevator pitch for it?

3

u/arjo_reich Nov 05 '20

Grr.autocorrect("Programming");

1

u/toastedstapler import itertools Nov 06 '20

1

u/Doppelbockk Nov 07 '20

Heh thanks, I figured I was just ignorant of the term perishing. :)

0

u/darthminimall Nov 05 '20

Big yikes on that preference order. C++ > Java > C#.

2

u/arjo_reich Nov 05 '20

lol, I did it just for you.