"I want to learn programming. How should I start?"

Wed, Aug 22, 2012 - 10:21am -- Isaac Sukin

This is a slightly edited response I recently wrote to someone who asked how to learn skills that would be useful at a hackathon. It's my usual response when someone asks how to get started programming.

You should start by approaching the problem from a different perspective. You should be thinking "I want to build X. Now what do I need to learn to build that?" not "I want to learn to build stuff. What can I learn?"

For example, I want to learn how to build an arcade machine. In order to do that, I've purchased a Raspberry Pi to run the emulator and recruited a friend to help me build the box. If I had started out by saying "I want to learn hardware hacking" I would probably have read a lot of articles on arduino and accomplished very little.

Especially when you are starting out, you should set achievable goals so you can feel good about hitting them. To get to a point where you have the skills to build something interesting and the experience to know what you can accomplish and how long it will take, you should work on projects that will not be failures if they are not completed in an artificially compressed time frame (like a hackathon -- although it can be worth participating in a hackathon just to see what it's like).

Good beginner projects tend to be more or less copies of things people have done before. I've written a lot of arcade games (see a pattern?) and my first large programming project was an open-source imitation of Facebook's News Feed for the Drupal CMS. I recommend starting with bleeding-edge technologies because you get to be ahead of the game in the job market; 5 years from now you may end up being one of the few people with the most experience in that area (I built my News Feed imitation in 2007, a year after Facebook announced theirs, and suddenly I have more experience with social networking technologies than most people who weren't on the staff of major social networks at the time). A good place to look is imitating existing software in new frameworks. So for example you could write Snake in HTML5 Canvas, or be one of the first people to build a Django site in Python 3, or write a browser extension to chat with other people on the website you're visiting backed by a Node server, or build pretty much anything for Windows Phone, or build a WordPress-like blogging engine on top of Meteor ("what if I live-streamed my blog post writing?")... and of course these suggestions will be out of date shortly.

Code is one possible choice of medium, not the end. It's a lot easier to motivate yourself and figure out how to reach your goals if you care about the end and the code is simply an implementation detail. Of course you can choose projects specifically because you'll need to learn specific things in order to achieve them, but generally I recommend starting with the possibilities of what you could build and then figuring out how to adapt your tools and skills to get there.

Discuss on Hacker News.