How I learn to program

Yesterday my friend Rohit asked me (in a comment) how I learn to program, or as he put it, “experiment with languages”. So I’ve decided to pull out my bag tricks and blog about how I learn to program.
There are lots of ways you can learn to program. Attend classes, ask friends, use the Internet, get a book etc. etc. For me, I took on a sort of challenge to learn how to program, without spending any money. So that means paying for classes and books is out of the question. So what do I do?
The first resource I reach for, is quite obviusly, the Internet. The Internet is the greatest repository of human knowledge ever accumulated. So use it. Generally, there should be a .org or a .com site for your language of choice. If there isn’t just Google for it. That itself should turn up enough resources to keep you busy for a week. In case you just want a quick overview of a language, just head over to Wikipedia and look it up. That’ll give you a rough feel of the language and will help you decide if you want to continue or look for another language.
Of course it is very easy to get overwhelmed by the amount of information the net provides you with. A lot of the information you find through Google will probably just confuse you. But there’s a little set of thumb rules that you can use to find the proper resources. Firstly, look for information and tutorials that are put up by people who are actually involved in developing the language. An excellent example would be the Python Tutorial by Python creator Guido van Rossum. Second, don’t look at tutorials that aren’t structured properly. If the document is in a very clumsy and inconsistent format, it will just confuse you. And absolutely avoid tutorials that stress on using a particular IDE, rather than the language itself. You should only worry about IDEs when you know the language very well. Third, a good tutorial or guide should provide a large number of examples and should explain them properly. One of the best ways to learn to program is to read though actual programs. Finally hang around forums, mail lists and the like. Not only are these good places to ask questions, you’ll learn a lot passively, by reading other people’s problems and solutions.
It’s certainly possible to learn programming, at least in popular languages, off the net alone. But in my opinion, if you are really interested in learning a language and are ready to spend some money, go get a good book. For a good book, it’s probably best to ask someone who teaches or uses the language you’re interested in. Still, O’reilly books are generally very good and comprehensive. Once again, try to get books written by people acting involved in the development and use of the language.
Books by Wrox are also quite good. I have read some books, mainly for C++ and Perl, and no, I didn’t buy them, I get them out of a library.
And most, importantly, write programs! You can’t expect to program properly if you don’t have practice. Ask anyone who has programming experience and you’ll learn that every once in a while you write some code which doesn’t do what you think it should do. The only way you’re going to reduce the number of times that happens is to actually write code and make yourself familiar with the language.
Finally, make friends with programmers. Friends are the best resource you can get. Not only will they help you when you get stuck, looking at their code will help you improve your own. Of course you have to find the right crowd, but that shouldn’t be too hard. And when you think that you’re capable of writing a mean piece of code, trying joining an open source project or starting your own. Once again, don’t bite off more than you can chew. Start off small, but do your work well.
After reading all that, if you still feel like learning how to code, go read How to Become a Hacker.

Tags: ,

Advertisements

Published by

Shrutarshi Basu

Programmer, writer and engineer, currently working out of Cornell University in Ithaca, New York.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s