As week 2 comes to a close, I feel compelled to write something about the difference between orthodox computer science pedagogy, as embodied by SICP, and the approaches taken by books of the variety of “Teach Yourself X in Ten Minutes.” I’m writing about technical topics in another post. This post is devoted mostly to the experience of tackling this material and a few musings on the psychology and the ethics of wicked-hardness. It is intended as commiseration and encouragement for the fellow autodidact.
I have a copy of Donald Knuth‘s The Art of Computer Programming on my bookshelf. It’s sitting there behind me as I type. Knuth’s book is a magical item. It has the power to make your into a Real Programmer.
I am not making this claim about The Art of Computer Programming because of Bill Gates’ offer to hire anyone who has digested the entire work. The Gates story is just a confirmation of what many people already believe about Art — that it contains powerful and profound wisdom, and the mere act of absorbing and digesting this wisdom will transform you, from the inside out, into a master.
Of course, The Art of Computer Programming is incredibly difficult, especially for the self-learner to whom its call sounds so loudly. During the four weeks I devoted to slogging through the exercises — each rated on a difficulty scale of 0 to 50, 0 being easy, 10 being hard — I wound up dreaming about algorithms, Fibonacci numbers, Euclid’s theorum. I couldn’t keep it up. My soul and will were too weak. This adept was not ready.
I’ve been thinking about The Art of Computer Programming lately because Section 1.2 of SICP features many of the same great moments in classical mathematicas that Art examines. In Section 1.2, we start with the Fibonacci numbers and end up with Carmichael numbers, the non-prime numbers that Fermat’s Little Theorum incorrectly claims are prime.
The authors of SICP apparently thought that an excavation of the intellectual history of mathematics would be a swell way to begin their introductory Computer Science book, and in particular to illustrate their points about orders of growth and the difference between recursive and iterative processes. And I thought I understood these two topics. I knew them quite well enough to apply them. But then I learned otherwise.
I’m coding in Scheme (hooray), but the coding is the easy part, almost trivial. Scheme feels like a good friend, believe me, when I finally get to writing the code. The analysis is the much harder part. What did I expect? Well, I wasn’t entirely prepared for transformation squaring or discerning the difference between sin^3 x and (sin x)^3 because most books I read as a self-learner aren’t teaching trigonometry or number theory. They’re showing you how to read a web form and place the POSTed data into a relational database. They’re what you might describe as more practical.
The distinctions between texts like SICP and the average self-learner-targeted book reflect very different priorities. SICP proceeds from the assumption that you want to learn how computers actually work, and how they run programs, and how they are used to solve some tough problems, many of them involving math or science. They do not assume that you are working every day with websites that basically gather and spit out strings and blobs of data in fairly mundane ways, and that what you really want is a better mousetrap — some new framework or design pattern or middleware platform. SICP does not show you how to write a photo-sharing web site in Scheme.
This is the point at which I might argue that SICP does NOT have to be this hard. After all, I read another book not long ago, Stephen Prata’s excellent C Primer, which doesn’t hold back on the pointer arithmetic or the binary trees, but doesn’t drag you along for a tour of problems that certain people are famous for solving. Sure, it’s designed to teach you C, not computer programming in general, but its coverage of issues of program design and memory management make it an excellent introduction to thinking at a fairly low level about how computer programming in the FORTRAN-C branch of languages actually works. Why does SICP have to be so much harder?
Yes, I know, SICP is an academic book. It’s not specifically for people like me, but rather for a classroom in which teachers and students interact, and the students are devoted fulltime to mastering the materials of their classes, with that mastery as their end, not just as a means to something else, like a favorite-recipes-for-pets-social-networking site. But the C Primer would be an excellent textbook too. I would use it to teach people about C and the related topics of pointers and algorithm design — no question at all.
Perhaps I’m suffering from a bit of insecurity, or even paranoia, after reading one endorsement after another, from people whom I respect, of the idea that the mastery of programming is too hard for mere mortals. So, are Ableson and Sussman trying to scare the wimps and posers out of the hall?
No. I don’t think one should react to the difficulty of SICP by taking it personally or suspecting a conspiracy against merely average-to-bright minds. First of all, as I’ve explained, SICP isn’t intended as a means of quickly bringing you up to an average level of proficiency at subject x. It’s an introduction to computer science that’s aimed at future scientists and engineers, people who will tackle really hard problems in the future.
There are a number of other possible good reasons why SICP is pretty darn hard. One is that Abelson and Sussman love their field and the related fields of math and engineering so much, and are so proud of these fields’ intellectual history, that they want to share all these details with us. I can respect that, because many of the discoveries are beautiful. I was explaining to a friend recently what I was up to, and he stopped pretending to be interested and actually brightened with curiosity when I explained how the Fibonacci numbers’ ratio of Fib(n) to Fib(n-1) approaches the golden mean — the ratio that defines nautilus shells and leaves and rabbit populations.
Another reason is that they don’t want to hold back on the hard problems. They want us to know right away how tough it can be to apply the things we’re learning. They want to keep us from getting cocky and ceasing to pay attention. They also may want to encourage us to think big about the problems we can solve with computing power.
But in discussing all of this, I begin to wonder, why should I be bothered by how hard the book is? It’s great exercise for the brain, and it’s an opportunity for the self-learner to have faith in himself or herself. Tell yourself, “I can handle this. It’s hard, but I can handle it. And it’s worth it.” There is no magic to learning something complicated. You have to take it a step at a time, as slowly as you need to.
I’m also grateful to have other interested people in the study group with me. They’ve been pretty quiet lately. Maybe they are also staggering a bit in the bracing difficulty of the material. But I have faith that we’ll all pull each other through in the end.