I know several programming languages: C++ and MATLAB at the level that I could do them as my job, and Java, Perl and BASIC at the intermediate level where I can do something in it if I have to. My approach has been the following since I started programming ~15 years ago (using Perl as an example):
1. Find basic tutorials online and do the routine "hello, world" stuff
2. Decide on a simple (~4 hours) project and do it using online tutorials. For Perl, I wrote a script to search for URLs in a text and change the URL to go through my university's proxy, which involved inserting .www.library.gatech.edu:2048before the first "/" after "http://"
3. Buy a book. My go-to series has been "By Example", e.g., "Perl by Example". I do not read them cover to cover, but rather skim the chapters as needed for a reference. I have not found online resources to be as useful as books for general language learning.
4. Do more advanced (~40 hours) project using the book as a reference as well as online examples for some of the trickier problems. For Perl, I wrote a very simple RSS feed aggregator that only aggregated items if they had a certain keyword in them. Took for-fucking-ever to set up the code to search only the <item> fields of the RSS feed and then output the aggregated feed in a browser-readable format, but it was doable over the course of a week.
5. Repeat 4 until you are bored
Ideally, the project is open-ended and allows you to build more advanced functionality as you get better.
Edit: I should also note that learning a language is different than learning to program in general. You will need to learn additional, more general things such as data structures and algorithms.
1. Find basic tutorials online and do the routine "hello, world" stuff
2. Decide on a simple (~4 hours) project and do it using online tutorials. For Perl, I wrote a script to search for URLs in a text and change the URL to go through my university's proxy, which involved inserting .www.library.gatech.edu:2048before the first "/" after "http://"
3. Buy a book. My go-to series has been "By Example", e.g., "Perl by Example". I do not read them cover to cover, but rather skim the chapters as needed for a reference. I have not found online resources to be as useful as books for general language learning.
4. Do more advanced (~40 hours) project using the book as a reference as well as online examples for some of the trickier problems. For Perl, I wrote a very simple RSS feed aggregator that only aggregated items if they had a certain keyword in them. Took for-fucking-ever to set up the code to search only the <item> fields of the RSS feed and then output the aggregated feed in a browser-readable format, but it was doable over the course of a week.
5. Repeat 4 until you are bored
Ideally, the project is open-ended and allows you to build more advanced functionality as you get better.
Edit: I should also note that learning a language is different than learning to program in general. You will need to learn additional, more general things such as data structures and algorithms.