Learning Programming

I’ve spent a while now working through online tutorials and doing programming exercises (Project Euler, Exercism, a few other places). What I’ve figured out is I have a fair handle on the syntax of the various languages I’ve attempted (Ruby, Crystal, JS, Elm, Rust), but I’m a terrible programmer. I’ve never found a good resource for fundamental concepts like when to use recursion or why to choose one data structure over another, much less just how to structure a project in a way that makes the actual coding more like lasagna and less like spaghetti. Can anyone recommend an online course or textbooks that I should look into? Thanks in advance.

P.S. I know this is off-topic for this forum, but this community seems to attract experienced programmers with teaching experience, some academic types, and self-taught programmers with practical experience, so I felt it was a good audience for the question.

Code Complete is the classic book for this:

I find that it is also helpful to read parts of the Rust standard library which I think is very clean and well documented.

  1. Pick a problem that is possible but difficult.

  2. Write messy/ugly/crappy code that solves it.

  3. Post a question of the form: I’m trying to solve X. Here’s my solution Y. I think it’s messy/ugly because of A, B, C. What is the better way to solve it?

The key point here is that every time you run through this “loop”, you find one “programming/design weakness” and eliminate it.

1 Like