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.