Julia Evans

How I learned to program in 10 years

The other day someone emailed me asking advice to learn how to program. He said he was planning to use “Learn Python the Hard Way”, which I understand is an excellent tutorial. I don’t generally like giving advice, because I think it’s way too easy to generalize your own experience into advice and do it wrong.

But then I found I had something to say! I thought a little bit about this blog, and how it might look like I sprang from the womb being excited about strace or thinking about how to build an operating system, or whatever. But in fact I spent about 10 years learning to program before going to Hacker School, mostly at fairly low speeds.

I drew a totally unscientific graph about what that felt like:

You should not try to conclude very much from this graph, but some events include:

  • I started learning to program in 2004, because my math teacher gave me a TI-83 calculator and then I wrote BASIC programs in math class.
  • A guy I added on MSN for some reasons I don’t totally remember told me to install Gentoo and use this new browser Firebird and I never tried Gentoo but I did install a few Linux distributions!
  • now I’ve been using Linux continuously for 11 years so that was a pretty great decision I guess.
  • My dad bought me Learning Perl and I was amazed to find out you could write subroutines and define your own variable names because on the TI-83 you only have about 26 variables (A-Z) and there are for loops but no named functions
  • I went to university in 2006 and somehow was given the root password to a lab with 4 Linux and 3 Windows computers and wrote some terrible perl scripts to do some user management and uh yeah
  • I finish university, with degrees in math/computer science. At this point (2011) I still basically don’t believe I’m any good at programming. I do not in any way consider applying to fancy jobs at Google or Microsoft or whatever.
  • I get a first job and a second job and coding 40 hours a week teaches me a lot about the software engineering side of programming

So, I went back the other day to some of the older code I’d written, thinking it would be terrible. Here, I put it on Github: julias-first-programs.

Notably missing is the perl script that I wrote in 2005 to convert the digits of pi to midi music to write to a cd to give as a gift (?!). I couldn’t find it.

And, sure, it’s not great code, but that’s not what was the most surprising to me. What was the most surprising was how little of it I found. It turns out that in the first years I was learning to program, I was also in school full-time, not studying computer science, and I didn’t necessarily write a lot of programs!

Most of what I found was little scripts like grepstuff.pl. And, sure, it’s not well-indented or anything. But the scope for most of these was so small (I was the only person writing or running most of them!) that it didn’t really matter if they weren’t well-engineered.

Anyway, this is mostly to say – if you’re programming and just starting out, and worrying that people say you can learn to program in 24 hours or 12 weeks… whatever. It’s taken me 11 years so far, and I’m not done :)

If you know how to program, and wrote your own version of this blog post, I would be interested to read it!

Title shamelessly stolen from Peter Norvig’s Teach Yourself Programming in Ten Years

A/A testing How gzip uses Huffman coding