Code Log 9.27.2012

Notes on what it’s like to write code.

It’s late (or early)—a bit past 2am on September 27, 2012. I just submitted my third CS50 problem set of the semester. It was titled “pset2,” (since, of course, the psets are zero-indexed), and marked two weeks of progress in C.

I feel like I’m finally getting the hang of C. It took some time; Ruby habits are hard to break. Ruby’s the programming language I’ve been using for the past few years, and although at a base level it’s actually written in C, it’s different in a number of ways. Ruby is elegant, forgiving, and unadorned; C is wordy, rigid, and laced with curly braces and semicolons.

I’ve been thinking about whether it’s better to start in Ruby and work backwards to C, or start with C and then move on to Ruby.

I sent Erik this text message right as I started working on the problem set on Sunday night:

image

Two hours later—just two hours!—I sent a followup:

image

My original prediction was right: I did feel amazing once I figured it out. And it didn’t even take lifetimes—just a couple of hours.

Looking at the timestamps now, I’m actually surprised that the turnaround was that quick. I remembered it being closer to 6 hours or something. I guess the overall coding session was about that long. But the core of it—the part where I went from despondence to triumph—happened in the slow blink of an eye. Something to remember for next time.

Yesterday, I posted some thoughts on CS50 and how we might start to usefully unbundle classroom experiences.

I read Bret Victor’s new post on Learnable Programming today (on Erik’s recommendation) and felt a surge of hope. Things don’t have to stay the way they are. At this point in my coding journey, I’ve learned to accept (and even appreciate) the sorcery of programming. But Bret’s post opened up my mind to remembering something I’d intentionally forgotten: how painful it is to do battle with a computer’s mental model at first, when it feels at its most unintelligible and unknowable. Bret has some solid ideas on how to change that process; they’re lovingly, persuasively illustrated in motion. Best of all, they’re embedded in a framework more timeless than the suggestions themselves.

In the post, Bret gives Seymour Papert’s Mindstorms: Children, Computers, and Powerful Ideas just about as strong a recommendation as is humanly possible. I figured out that Harvard carries a number of copies in its libraries, so I’ll be tracking one down. (The call number for one copy is sitting insistently in my inbox right now.) I think Erik’s going to read it, too.

Things don’t have to stay the way they are.

  1. buzz said: Personally, I believe C is a good language to start with because it’s close to the metal. You learn more about memory and what is actually going on under the hood than with a higher level language like Ruby.
  2. dianakimball posted this