How to Learn Programming Languages - Fast!

by Loren Larsen

Last updated: 4/8/2006

Introduction

This article is adapted from a post made in 1998 on an Internet newsgroup about how to use accelerated learning strategies to learn new computer programming languages. I have modified it a little bit and posted it here because I think it is still highly relevant and useful.

The gap between average performance and exceptional performance is often enormous. In computer programming the gap between an average programmer and an exceptional programmer is said to be 1000%. That is a pretty big difference. This is consistent with my own observations. In particular, a similar gap appears to exist in the time it takes an engineer to achieve mastery of a new technology, including a new programming language . I've seen and personally experienced a huge gap between the rate at which different people can learn a new programming languages. The gap is sometimes due to experience in programming, basic knowledge and even intelligence. I also strongly believe it has to do with the learning strategy employed. The article below will reveal one of the "secrets" of those who rapidly learn new programming languages. I've lost track now of how many programming languages I've learned to a functional level and I won't bore you by listing them out. I've had very different experiences learning different languages, some were easy, some were hard - for me. Obviously if the whole paradigm is different like learning a functional language like SML might be harder if you've only done procedural programming, but the rest of this article will describe a strategy I've used a number of times to very rapidly learn new languages (C and Java jump immediately to mind). I'm talking about I'm describing here learning to be very functional with a language in anywhere from 24 hours to a week. Usually 48 hours is sufficient to become very very functional with a language. The basic strategy goes like this:

  • Gather material
  • Actively speed read the material and then dip
  • Let the information germinate
  • Implement trial projects
  • Review

Gather material

First go out and find 4 or 5 high quality books on the language, one that is a tutorial, one that is a reference, and some smattering of others. If you can't find 4 or 5 books, one comprehensive book is probably enough. You may also collect a number of web-based tutorials or source code repositories.

Actively Speed read the material

Block out 1-2 days where you don't have many other committments. If this means skipping classes or working from home and turning off the cell phone. Do it. It's very important to success of this accelerated learning approach.

Then I'd plan to wake up early and start reading, and read as fast as I possibly can, not being too worried about getting every detail yet, but making sure that the major pieces are there. Ask questions like:

  • How are variables declared?
  • What types are available?
  • How are functions declared and called?
  • How are conditionals and loops formed?

Is this a procedural language or object-oriented language? If it's object oriented, a whole new set of questions emerge, but I won't go into them here...Usually all of these questions can be answered as you read in about an hour, maybe two if it's a complicated language, and maybe more if this is your first programming language. As you read more questions will come up. I recommend, asking questions, but NOT trying to find the answers immediately. The key to this step is inputting a lot of information and not getting caught up in the details. The questions will generate a state of curiosity and get your mind engaged.

After this, I usually start to scan pieces of example, code noticing things that jump out at me, noticing the structure of the programs, how the author has chosen to format and lay out the code. Basically, I want to start finding things in the programs that I still don't understand about the language.

Let the information germinate

At this point take a break and do something recreational and let your mind mull over the questions and start piecing it together and asking yourself questions about how you would write a program to do such and such. So pick a project. I have a couple classic examples I usually start with like, how could I write a program that would encrypt a file using a very simple cipher like XOR? This requires that I think about how to do file I/O, manipulate bits, etc. Then I usually think about how to write a simple database program where the user just enters records and a linked list is kept of each record, or something pretty easy like that, but that requires some kind of dynamic data structure. Then I think about how to write an application that has lots of user input, maybe even a GUI. For example when learning a language like Java, GUI issues are 80% of the challenge.

And all of this has been mulled over casually while doing something fun that is completely unrelated and mentally relaxing. My favorite thing to do is shoot some hoops. I also like to go for a run or hike. I usually choose to do something solitary so I can really let my mind wander around the language, the project, etc. I expect that playing a computer game might also work, although my current theory is that a cross hemispheric activity like juggling, swimming, basketball is optimal.

Then go back, and find the answers to any questions you have about how to write the programs you were thinking about. Usually I find that it takes an hour or so to fill in the details pretty well. The key point here is not to get to caught up in details, as long as you get the idea of how something will work that's enough.

I usually do the above steps in a 4-8 hour period, depending on the language, quality of the material, and interruptions. Sometimes I start in the evening and finish up the next day. Then no matter what I always let this simmer for at least one night so I can sleep and dream about it.

Implement trial projects

Now I recommend getting on the computer and start playing. I nearly always choose some simple project to implement that will let me use all the features of a language and its standard libraries. A simple database is usually a choice I use because it uses all the pieces and it doesn't require making up new algorithms or anything because I've done that many times in other languages and lets me focus on what's unique about this particular language.

Review

Once you have completed one or more trial projects are complete, take a step back and review what you've accomplished. Briefly inventory what you have learned. You may also notice if there are areas you don't understand well or that you just haven't explored. Review your original objective in learning this language. Then make new goals and a plan for moving forward.

What to expect

Usually I spend a day to a week playing around and completing the project, depending on the complexity of the project I choose, my available time, and the language. For example, when I learned C, I spent 6 hours reading a book, then I spent about 10 hours the very next day writing projects, and in that time I'd used 80-90% of the languages features. When I learned Java, I did the reading in one evening 2-3 hours, and because of time constraints I spent about 1 hour a day for about 10 days before I felt I knew the language and its libraries pretty well. At the end of I had created an application that I posted on the internet that people found useful.

For a little comparison, when I learned C++ I didn't use this approach at all instead I learned it a little bit at a time, here and there, and even though, I write nearly everything I do in C++, I still feel I have less mastery of it than say C or Java. That may have more to do with the language than me personally, but I'm not sure how to assess which way it is.

This is my preferred strategy for learning new programming languages. This is not a traditional approach, but it yields rapid results and is very rewarding due to the rapid progress that you can make. I hope you find it useful.