A good friend of mine, who is currently teaching himself Python yesterday confronted me with a rather familiar problem. He complained that he was experiencing coder’s block: that he didn’t know what he should program. This is a problem that comes up rather frequently especially for new programmers who are teaching themselves programming. Learning how to program gives one a new found sense of power and it’s understandable that soemone who has just discovered this would be itching to ty it out. The problem is: how?
No matter how high-level our languages may be or how many libraries we might have at our disposal, programming is still a considerably hard job. Writing large meaningful programs on your own, especially as a beginning student is not an easy thing to do. The two answers that I’ve heard the most, on IRC and on various forums are:
- Find a textbook or something equivalent and do the exercises.
- Write a program to automate some common task that you perform repeatedly.
Though both of these suggestions have merit, I feel that they are not really the best choice. Let’s look at textbooks and tutorials. Most of the exercises that are presented aren’t really geared toward doing something useful, but rather to learning some specific concept or feature. These exercises are great if you’re looking to building your skill set (I’ve been going through the SICP exercises in my spare time over the past few months) but they don’t give you the same satisfaction you would get from building something useful.
Writing automator programs seems to be a more popular suggestion and I think it’s a reat suggestion, very in-tune with the whole hacker ethos. However, that’s easier said than done in today’s day and age. If you’re an experienced command-line user then there are probably a lot of things that you find could use some automation: setting command options, file moves and renames etc. etc. But let’s face it, most of today’s beginnings programmers are not command line afficionados and may never be. Automating things programmatically in the world of point-and-click GUI is not a very easy matter for a number of reasons. Firstly, there’s a lack of a general-purpose ‘glue’ language to program the GUI in: nothing analogous to simple BASH or Perl script. If you’re on Windows (for example) how do you writing a simple throwaway program to quickly rename your whole MP3 collection without having a good knowledge of Windows internals? The very fact that there is actually software out there that costs money to do things like bulk renames, shows that it’s not something that an end user can easily automate on their own. Secondly, the entire graphical paradigm by itself does not easily lend itself to automation. It’s not easily clear how you’re going to automate something like setting the buttons in a configuration GUI, unless the GUI is just a front end for a config file, in which case you would just by-pass the GUI anyway.
So this still leaves us with our original question: what would a novice programmer pick up as a small project? I would say instead of looking for something to do, try reading. Read up on some moderately advanced computer science topic that you’re interested in. Then do whatever you need to do to facilitate that interest and make your learning experience complete. I’m currently doing an independent study in programming languages at the moment and this has sprung from the fact that I was bored last semester and wanted a substantial task to pass my time.
The benefits of this is two-fold: you’ll get to learn more about an advanced topic and see what you’re interested in (which is always a good thing). And it will also solve our initial problem: finding a problem that is interesting and challenging. It might also lead to more things that are interesting and more interesting code to write. In my case, I’m using doing a lot of functional programming in Lisp-like languages. Since I wanted to streamline my workflow (and get more experience with Lisp outside academic problems) I took up the task of learning Emacs. Emacs is almost infinitely customizable and programmable and I currently have a small list of things that I could do, but aren’t essential. Things that I’m putting off for a lazy afternoon.
Perhaps the jist of this post is this: scratch an itch, and lacking one, find something interesting to study. My final recommendation to my friend was to write an emulator for an old processor for which he found the manuals. He’s interested in operating systems and close to the hardware code and I think this will give him a fun project to keep him busy for a while. There’s sure to be something similar that catches your interest. The computer industry started on the back of hobbyists and people just looking to do something fun. Keep that spirit alive.