I have started to learn to program. I am interested in it and dont mind how long it takes to learn. But I am using books to start out and I find that there are some things I get and some things I have no idea.
I can understand the code when I see an example but I feel completely lost if I were to go out and do something on my own. I have barely any experience: maybe 20 or so hours, which I understand is absolutely nothing.
- When does everything come together?
- What are some best ways to learn that anyone else has found?
- Are there any good projects people have done that have been a great learning experience?
3
The absolute best way to learn how to program is to write code.
There’s no way around it, especially as – and you said so yourself – it’s the goal in itself.
Reading is For Background and Research
Books, blogs, podcasts and the likes will get you started and give you general background and knowledge at first, and then help you study more complex algorithms or learn about software engineering techniques and best practices.
Get Started
If you want to learn to code, you need to code. Pick a language, find something you want to start working on, and get down to it. Or find a list of small exercices and do them.
Possible Book Suggestions
Several approaches. In any case, it’s vital that you actually do what the books tell you to do and don’t just simply read them.
For the Practical Mind
If you’re the practical kind, these would be good introductory books to coding. That is, if you’re curious enough to then go beyond what the books teach you:
- Learn X the Hard Way Series, by Zed Shaw
- Learn Python the Hard Way (the original)
- Learn Ruby the Hard Way
- Learn C the Hard Way
- Why’s Poignant Guide to Ruby, by why the lucky stiff (aka Johnathan Gillette)
- Learn You a Haskell for Great Good, by Miran Lipovaca
Some will say they are light on the details and overlook very important concepts, but the point is to get you going and to enjoy programming quick. So if you’re easily distracted and want to see quick results, maybe these are for you.
For the Academic in You
If you’re the studious and academic kind, these are good bibles, if you get past the fact you can also use them to kill someone:
- Structure and Interpretations of Computer Programs, by Hal Abelson, Jerry Sussman and Julie Sussman
- Concepts, Techniques and Models of Computer Programming, by Peter Van Roy and Seif Haridi
Some consider them not a good fit to get started, because they are detached from the reality of software engineering in professional settings (mostly because of the languages and tooling used, but also because of the purity generally sought in the answers).
They are extremely good books though.
For the Life-Long Learner
Or at least for the one who goes beyond just learning the basics and wants to dive into the more arcane areas of the craft, both in terms of algorithmics or in terms of software engineering practices:
- The Pragmatic Programmer, by Andrew Hunt and David Thomas
- The Art of Computer Programming (can also be a decent armor plate, or provide lots of energy in winter), by Donald Knuth
- Software Engineering, by Ian Somerville
- Refactoring: Improving the Design of Existing Code, by Fowler, Beck, Brant, Opdyke, Roberts
- Working Effectively with Legacy Code, by Michael Feathers
- Clean Code, by Robert C. Martin
- Code Complete *, by Steve McConnell
Suggested Helpful P.SE Threads
- Able to read Code but struggling majorly to write it (actually posted just a few hours before your question)
- How can I really master a programming language?
- https://softwareengineering.stackexchange.com/questions/151229/im-having-trouble-learning/151242#151242
- Learn programming backwards, or “so I failed the FizzBuzz test. Now what?”
* For some reason unknown to me, I dislike this book very much. Blasphemy, I know, right? Too heavy, hard to navigate (subjective), repeats itself too much and could easily be half-the size. Maybe because I read it too late in my career, I don’t know.
6
How do you learn to swim? By swimming.
How do you learn to program? By programming.
You can’t learning to swim by just reading books, nor can you learn to program by just reading books (not to say reading is not important, it is important, in addition to practicing).
So start writing simple programs as much as you can, there are a lot of exercises on the internet.