Coder’s block

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:

  1. Find a textbook or something equivalent and do the exercises.
  2. 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.

Advertisements

Published by

Shrutarshi Basu

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

4 thoughts on “Coder’s block”

  1. I think exercises are better. You already know you want to learn everything about the language, why wait for “the right time”? Train every day like a Spartan, and when that “time” comes, take off the leash and carve it up.

  2. I find exercises are better as well, you can’t retain a lot of programming knowledge without at least implementing some of it. You might know what a Red-Black tree is, but when do you need one? When does knowing the internals of your compiler become important?

    As for what exercises, there’s always the fun ones too: games (pacman, go, chess, tic tac toe), a random daily message generator, your own do whatever and only whatever you want calendar. Two years ago I was in a class studying Russian and wrote my own flashcard system in Java so my other classmates and I could more effectively study Russian. I simply couldn’t find a good existing product out there that was free.

  3. ah. basu. I’m honored (*grins*) that my little coder’s block merited a whole post. Partly, anyway.
    Well as u know my problem was solved when i went thru dad’s old programming books on the 6502 architecture – the tkinter-frontend emulator for that instruction set modified slightly for better functionability. thanks for your suggestions at the time.

    exercises have that spartan training but that “time” sometimes has to be created too.

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