The 11 step algorithm for learning a new programming language
I'm currently in the process of learning Lisp, and I'd recommend the following algorithm:
- Ask around if the language is worth learning and where good resources can be found. If positive responses to the language are given by experts then proceed to step 2.
- Create an initial programming environment. Keep it simple: text editor and compiler/interpreter. The bare minimum. Consider a specific user account on your machine with a special colour scheme to cue the change of mindset.
- Create the "Hello, World!" application.
- Learn general syntax and control statements (if-then-else, repeat-until etc). Create sandbox to verify simple control cases (true/false evaluations etc). Try out every primitive type (int, double, string etc). Perform currency calculations. The number guessing game (as suggested by @Jeremy) is good for this.
- Create class (if applicable) with several methods/functions. Make calls between functions. Apply control statements.
- Learn arrays and collections. Create suitably complex examples that create arrays and collections of each of the classes/functions/primitives that are available to you
- Learn file IO. Create examples of reading, manipulating and writing binary and character based files.
- Ask more questions about idiomatic programming within the language (pointers, macros, monads, closures, support frameworks, build environments etc).
- Choose (or adapt your existing) IDE to work in the recomended idiom.
- Write a variety of applications that please you (or your boss).
- After 1 year return to step 1 for another language while maintaining your interest in the one you've just been learning.