I studied Electrical Engineering in undergrad and the only programming languages we've had to use in EE were C/C++, Assembly, and Matlab. After going to a
Startup Weekend event and getting interested in software dev and computer science I decided I wanted to get my hands dirty and jump in the field. I realized I would need to learn a different set of languages to hack together projects.
In the past year and half I've been learning Java (for Android), Python and JavaScript (& HTML/CSS) (for web development) and I've come to realize that the best way to learn programming from a book or tutorial is to read it 3 times! Yes, read it 3 times!! Reading new content this way has helped understand new languages/concepts well. I'm confident it can help you, a beginner to programming or a certain programming language, maximally absorb knowledge from whatever it is you're reading.
The First Read
My first read of a programming book is to just read for light understanding. In the first read I try to follow the author and where they are taking me with the examples. I also learn, not fully, the syntax and try to understand how the programs flow.
I don't type any code in the first read. I think because I have previous programming experience I can usually follow any programming book. I don't expect myself to code in the language I'm learning or correctly apply the content I'm learning after the first read. I do however have a good sense of what's going on.
(Btw, I usually read a chapter or section at a time, not the whole book).
The Second Read
In the second read is when I type out code. I usually type out each example in a section. The reason I read the sections first and then comeback to type out the code is that I understand where the section is going and I know what the code can/should do. I have a good understanding of what's going on, I'm not just typing code blindly, waiting to be told what it does in the following paragraphs, and then going back up again to re-read it.
Typing code I understand helps me remember the syntax.
The Third Read
In my third read I try to do the examples without having to copy the code. I usually just go to the section or chapter exercises and try to solve them. By this stage I remember the syntax introduced in a section/chapter pretty well and I can just solve the problems.
Yep...
This is what has worked for me to learn Java, Python, and JavaScript. Another great way to learn programming languages or concepts is to do a personal project. So if you wanted to understand more about GUIs or graphics in Java, try to build a PvP Chess game, this will force you read on graphics, animations, gui's, event driven programming, etc.
The problem with solely doing a personal project w/out reading a book on the language is you won't be applying the best practices for completing a project (in that language) but you'll just try to get the job done. You also won't know how to really code
in that language, especially if you're coming from another programming language. What I mean is that you may be writing C style code in Java because you haven't learned
the way of doing things in Java because you know C and you're just trying to pick up Java syntax to get the job done.
I recommend learning a new language from a book for starters rather than following tutorials. You get a good narrative from a book. But when you're going through a book, don't confine your work to the exercises in the book, try to do your own projects. Also be sure type the code you're learning,
don't think that reading and understanding code is enough!
I'm not an expert software developer (yet) but learning about programming/development this way has definitely helped me get around pretty well. Let me know what you think of my approach in the comments below :)
Posted by
Ahmed Abdalla