Learning Programming

My relationship with programming has a long and sordid past. We got our first computer when I was very young, and I was immediately transfixed by this devil machine. How did it possibly work?? This curiosity got me a handful of vague enough answers to temporarily satisfy me, and I went about playing Dune II. I remember at one point creating a file, adding .exe on the end, and telling people that I “wrote my first program”. When they asked me what it did I had no answer.

Years later I started to realize that I wanted more. I wanted to be able to command the machine. I knew this was possible to do through this thing called “programming”, though this was still vague. At one point I even said I wanted to be a programmer when I grew up. In retrospect, this skill seems valuable enough that I wish my parents had given me more of a push / support when I was younger – certainly we intend to introduce Lydia to Logo at a young age ourselves.

As it so happened, my dad did at one point give me a book about Java. I proceeded to do a few lessons, marvel at my ability to make the computer prompt me and spit out some text, and promptly forgot that it existed. I wanted to program games, not some trivial input/output stuff. There just wasn’t the hook, I didn’t feel like I was working towards anything useful or fun. This perspective did pan out later, when I learned some assembly to write custom commands for StarCraft modding, and some C++ to write simple text-based games with a friend of mine. These attempts were in no way systematic education – I was mostly looking at other people’s code, figuring out what it did, and then modifying it to do what I wanted instead. This did provide me the immediate feedback that was so gratifying though.

Back to the Future

My dreams of becoming a computer programmer were temporarily thwarted when I got to college and realized that finance was where the money’s at. I decided to buckle down, major in economics, spend my time foolishly, do my investment banking internship, and dream of the six-figure starting salary. This dream died before I graduated. That said, my work in econometrics did help me to think algorithmically. Using statistical software like SAS, Stata, Matlab, etc, does effectively teach basic CS concepts like loops, for example. Perhaps more importantly, it gave me experience writing and debugging code.

After the financial crisis and going to work at the Federal Reserve, I realized that my original goal of becoming a programmer was a better idea than I had thought. It seemed like the one place the bust wasn’t being felt was Silicon Valley. The dot-com bubble may have disappointed, but the best tech companies continued to rise, and startups continued being formed. Venture capital was looking pretty good among record losses in public equity and other markets. My programmer friends were suddenly the ones with the six-figure salaries and confident in their job security!

So in my spare time I started trying to learn programming again. Unfortunately it looked all too much like my earliest attempt to learn Java: I got through a few sample lessons, and very quickly lost interest. I simply didn’t get that visceral sense that my efforts were building towards anything. Sure, I abstractly realized that if I continued on this path, I would wind up with the ability to do anything I had seen others do… but each time I wrote another print statement something died inside of me. I wanted to do something already!

Fast Forward

Today, I am rapidly churning through Learn Python the Hard Way and Udacity’s CS 101 course. What happened? What is different now? The answer is that I was applying for an analytics position, and they wanted me to do a programming puzzle. This programming puzzle was way beyond my meager abilities to that date. They wanted me to construct a complete working analytics dashboard, from setting up the database, to handling the back end in a RESTful manner, and then constructing a front end at all, displaying data visualizations and the whole nine yards. So what did I do? I decided to consider it a challenge and tackle it head on.

This was the right call for two major reasons. First of all, it was forcing me way outside my comfort zone – I was living at my edge during those two furious days worth of coding. At first it seemed overwhelmingly impossible, but after several hours of working with a talented programmer through my blocks I had a basic working web server. The first time I saw one of my pages displaying actual data from the database, something inside me clicked. This gets to the second major reason: I was building something that solved a real problem. I was simply blown away when I saw that within just a few hours I could get a minimum viable product. Now that’s real power, not at all like those hours upon hours of print statements and arithmetic…

Learning Programming from the Inside

So now I’m in full swing, feeling the motivation and following through with it. I started with Learn Python the Hard Way, on the recommendations of my trusted programmer friends. That honestly does require significant motivational effort to get through – it suffers from the same problem of print statements and arithmetic. Only that previous experience was enough to keep me going. Udacity’s course is actually much better for me because they have frequent quizzes and problem sets, where they ask you to solve algorithmically interesting problems along the way. Even though it can be done with simple tools, and I may not ever need it, writing code for how to check if a matrix is symmetrical feels like an intrinsically fun puzzle. It’s also possible I would have found CS 101 a lot more frustrating if I didn’t already have a solid Python base from LPtHW, it did seem like some things were almost brushed over casually.

I have two main reasons for learning programming, one of which I alluded to above: I want to have that feeling of empowerment from knowing I can do things with computers, the utilitarian aspect of programming. But as I have said before, I am also constantly looking for new metaphors through which to view reality. Algorithmic thinking is clearly one of the major paradigms through which to understand the world – this first hit me when reading Darwin’s Dangerous Idea, still one of my favorite non-fiction books to this day. Although I had much of this way of thinking in place already, I find that I am thinking more concretely in terms of programming procedures as well as intermediate abstraction computer science metaphors. In some ways, I like having new ways to view the world as much as having new ways to change the world. Depends on which mode I’m in I guess.

Most of my free time of the past week or so has been dedicated to programming, and I’ve actually been running up against the limits of my ability to incorporate new information. It has been a long time since this has occurred, and it feels good to learn at my edge. I know I have hit a physical limit (probably consolidation requirements) because my motivation to continue is still strong, but it feels like concepts become more “slippery”. To unpack that a bit, it seems like I lose a train of thought with higher probability at each step along the way. First it becomes harder to translate a basic structure in my head into specific lines of code. If I press forward anyway, I start to lose the ability to even hold the different components of the program in my mind to see how they would fit together. This feeling is alleviated when lie down and free associate for a while, or much more when I get a night of sleep. Problems I could not solve the previous night are trivial in the morning. (It is also notably different from being emotionally triggered and wanting to avoid doing work: when that happens I no longer feel the same motivation, and lying down will not fix the situation alone.)

Summary

I recommend that people learn programming if they are at all amenable to the concept. It is both a way of viewing the world, and gives you incredible tools (and job prospects). Computers are only becoming more and more important. Empirically, the people I spend the most time around do tend to think systematically, whether or not they are themselves programmers. And as Divia would point out, learning to debug code is actually learning to debug your own brain, which is a powerful aspect indeed.

  • This is an incredibly powerful post. Your ability to put the “metaproblem” of what stood in the way of your motivation to learn programming into words is immense. It maps onto my own situation very precisely.

    Beyond that, I love how you elucidate the power of “thinking algorithmically” and the related concept of looking for new metaphors through which to view reality. I have more to say about this, but for now I think I will jump over to your post on that subject and see if that’s the more appropriate place to comment.