Tuesday, February 01, 2011

(Re)learning to Program

Warning: Mild to moderate nerdery ahead. Proceed with caution.

I am officially unemployed for six more days. What to do with my time? Some people might watch a lot of daytime TV. (I maxed out on Hulu last week.) Some might exercise excessively. (It's currently -6F outside, and I've already destroyed my legs.) Or, some might teach themselves to program in Python!

Here's the relevant backstory: Both of my parents are software engineers/computer scientists/humongous nerds. As a result, I shunned anything related to programming for the first 20-odd years of my life. I took two programming courses in college, but...
  1. back then I thought problem sets were lame and gross
  2. one of the classes was in Ada - a gross, unwieldy language 
  3. the other was a class assumed I already knew Java when I didn't, which was kinda gross and unfortunate,
...so I didn't really get much out of them. (Yes, I find this shameful and sad. If I were in college right now I would learn so much more than I did at the time. Bygones...)

As it turns out, I really like programming. It's fun and stimulating and not boring at all! Really! Had I gotten over my familial aversion to programming earlier, I might have actually majored in EE/CS and maybe, just maybe, I would have liked it and I wouldn't have rejected a technical career.

Let's turn this into a silver lining, shall we? I truly think that looking at technology and science from a humanist perspective is where I am supposed to be. (Let's face it: I'm fascinated by programmers and technologists and their ilk.) Had I studied CS and liked it, it might have taken me a lot longer to come to that conclusion.

Or maybe I'm just equivocating.

Anyway, the point is, I feel like I really should learn how to program things in a way that is intuitive and natural. How else am I going to be a programmer-journalist? So I'm taking a class through MIT OpenCourseWare (basically the most amazing resource ever - if you haven't seen it yet go look at it right now...did you do it yet?): 6.00 - Introduction to Computer Science and Programming.

I'm a total noob and I love it.

The first problem set is safely under my belt. And guess what? Not only was I excited to do it, I was excited to write the programs and then write them again more efficiently. Not because I had to, but because I wanted to. So weird. (My dad suggested I simultaneously do them in JavaScript...we'll see about that.)

I must be getting old because I want to do homework for fun. Also, I laugh at all the jokes in the lectures (especially the painfully cheesy ones) when the undergrads remain silent...how embarrassing!

Here's the printout from one of the first programs I wrote. Cool, huh? It shows you that as n gets big, the product of the primes that are less than n approach e^n. The bigger n gets, the closer the product of the primes gets to e^n. Neat!
So I might post some updates on my progress here. This will probably be boring to everyone but me. Consider yourself warned...