SICP Section 1-1: Just lulling you into a false sense of security…

SICP doesn’t read like a typical programming book. It’s a lot more like math. Real math, now… I’m not talking about some sort of crummy calculus course.

It brings back memories. I was once one of four students at a small college taking Foundations of Mathematics. The teacher was a pretty old guy and I was encouraged to go ahead and take the course with him because he wouldn’t be around much longer. I remember talking about a question he had up on the board. “Well… it’s like this, you know? This and this go like this… and this is what’s happening, you know?” “No, we don’t know,” he says to me and the class.

I don’t think I’ve used the phrase “you know” in conversation since.

The thing about the subsections of a chapter in SICP… I can read over them and have no idea what the point is. I can reread a section and then sorta get a better idea. But when I do the exercises, then it’s like, “oh… that’s what they were trying to tell me!”

(Oops. It looks like I still need to work on over-using the word “like.”)

My learning style is really a trial-and-error kind of thing. I mentally propose hypotheses… and then test them until I get closer and closer to understanding what’s going on. I’m like a human version of the sqrt function from section 1.1.7. But the bad thing about that kind of black-box mess-with-it-until-it-works approach is that I can alter code to do new things without even understanding it. It wasn’t until I solved exercise 1.8 that I understood how that sqrt function really worked! And that was even after messing with it heavily in Exercise 1.7….

There was nothing truly mind-bending yet in this chapter, but it is interesting to know the difference between applicative-order evaluation and normal-order evaluation. I can see how that might have a major impact on certain algorithms. A few other tid bits included the fact that you can put an expression in place of a function name– an if statement, for example. (I’d never seen that before.) This could allow for some pretty concise code in certain situations. The block structure demonstrated in section 1.1.8 is similarly expressive, and can be implemented similarly in Common Lisp with the labels special form.

All in all, this first little taste of SICP is not all that fun. If not for the large amounts of praise this book has received, I probably wouldn’t suffer through its exercises. My work is here if anyone’s interested in comparing notes. I did all of my work in Common Lisp and the only real problem I ran across was that the sqrt function would crash slime badly when I ran it with large values and I’m not sure why.

5 Responses to “SICP Section 1-1: Just lulling you into a false sense of security…”

  1. Ken Dyck Says:

    Welcome to SICP! I’ve been working through it for a while — quite a while. Anyways, I’ve been posting my solutions to the problems on my blog — http://www.kendyck.com/solutions-to-sicp/ — if you are interested in comparing notes.

    Also check out Eli Bendersky’s website — http://eli.thegreenplace.net/). He’s been working through SICP in Common Lisp and posting notes and comments along the way.

  2. lispy Says:

    Nice…. I’m not too far behind you guys. If I can bust through section 1 quick enough I might catch up.

  3. Eli Bendersky Says:

    It’s a date ! 🙂

  4. Eli Bendersky Says:

    By the way, if you find SICP difficult, watching the lectures may be of help. All the SICP videos are online here: http://www.swiss.ai.mit.edu/classes/6.001/abelson-sussman-lectures/

    The quality is pretty good and the lecturers (the authors of SICP!) explain the material well.

  5. Mastering Higher Order Programming Techniques with SICP Chapter 1 « Learning Lisp Says:

    […] Higher Order Programming Techniques with SICP Chapter 1 Section 1.1 was deceptively simple, but things rapidly got heavy in section 1.2. The process of tree recursion was exceedingly […]

Leave a reply to Ken Dyck Cancel reply