The hawk and the tower

Book-tower-w400

Behold the tower of good intentions!

The stack of books shown in the picture is my accumulated backlog of unread books. (Of course, in terms of data structures, it’s not really a stack, it’s more like a priority queue. Although the priority tends to be skewed somewhat towards the most recently purchased books.)

As you can see, the tower is made up of completely awesome, jaw-drop-inducing books. (You can browse them here if you’re interested.) I’m quite convinced that there are no better books out there — except perhaps Knuth, but we already discussed that. (Also, I wasn’t able to locate my copy of Jon Bentley’s Programming Pearls for the picture, otherwise it would be in there somewhere.) And yet I haven’t read any of them! That is, I may have read the introduction, maybe the first chapter, in some cases a bit more. But I don’t think that I’ve read more than 10% of either one.

Now the weird thing is that somewhat pathetically, I’ve always associated a bit of pride with my tower of books – as if merely owning these great books would somehow cause some of their greatness to rub off on me. The notion is clearly absurd – it makes no sense – but that’s the way it has been. Lately though, I can’t really look at the tower without thinking of my favorite Whitman quote, from Song of Myself:

The spotted hawk swoops down and accuses me, he complains of my gab and my loitering.

Gab and loitering indeed! I read about books, I purchase books, I write blog posts about books – what about actually reading them?

Clearly the feeling of pride is inappropriate and unfounded. You take pride in what you’ve done, not what you may or may not do in the future. What does the tower represent? The opposite of action! The absence of accomplishment! It’s a monument over things I haven’t done!

The best thing you can say about the tower is that it shows some ambition and awareness – at least I am knowledgable enough to recognize great books when I see them! I guess that’s something. A morsel. And of course the tower represents potential energy in the sense of potential learning. I have a well of knowledge available, right in front of me, that I can tap into any time I want to. Finally, the tower arguably says something about who I would like to be, what I would like to know. For instance, it is easy by glancing at the tower to infer that I have an interest in functional programming in general and Lisp(s) in particular. That’s good, I suppose – I feel OK about that.

What appears to be lacking, though, is commitment, focus, and getting things done – in particular getting books read! This has deeper repercussions as well, because it casts a shadow of doubt over the proclaimed ambition. If I really wanted to learn all these things, shouldn’t I be reading my books?

Let’s not jump to any conclusions just yet, though. First, let’s hear from the defense. What is keeping me from reading?

Well, there are two primary impediments that come to mind: time and discomfort.

Time is pretty simple. I have a family, hence I don’t have time. Or rather, time is always a scarce resource. After the kids have gone to bed, I have 2-3 hours available to do “things”. For the week in total, I’d say the number of free hours oscillates between 10 and 20. Reading books now has to compete with any number of other activities, both mandatory (doing laundry) and optional (watching a movie) and in-between (spending time with my wife), for a slice of that time. Hence there are limits to the amount of time I both can and am willing to put into reading. The builder of the tower, on the other hand, isn’t aware of time – he just tends to purchase all the books he wants to read. So there’s a gap there. It’s not at all obvious that the time I have available will be nearly sufficient to consume books as quickly as I buy them. In fact, let’s investigate it a little bit by doing a bit of trivial math. Methinks the math will speak volumes about the realism of working my way through the tower.

For instance, say I want to learn Python in greater depth. I decide to work through Zed Shaw’s Learn Python The Hard Way (which is not in my book tower, but it is on my wish list! Oh dear.) It seems like a reasonable way to go. Now, LPTHW consists of 52 chapters. That means that if I work through one chapter per week, that’s an entire year to work through that one book. Obviously I could cut that down to half a year by doing two chapters peer week instead, but I would have to double my reading budget. I could cut it down to three months, but then I’d have to quadruple it. Am I willing to do that? I’m not sure, because truth be told, I don’t actually have a reading budget. So I can’t really answer those questions meaningfully. (I guess that’s an improvement point right there. I should totally make a reading budget. (And a laundry budget. And a movie budget. And a wife budget? Don’t think I’ll get away with that.)) Still, it’s fairly obvious that I have to prioritize quite heavily which books I really want to read – and that working my way through the even parts of the tower is going to take years. Might as well come to terms with that.

And that’s pretty much it for time. Make a budget, prioritize accordingly. The budget cannot be made arbitrarily small and still be meaningful, though. When I read a book, each sentence leaves a rather soft and volatile imprint in my memory. It will get wiped out relatively quickly if I don’t keep at it. There’s a critical mass of sustained reading necessary in order to keep my mind in the book, so to speak. It’s like riding a wave. If I don’t keep with the flow, I will fall off with a splash. Then I will have to backtrack and re-read and try to ride the next wave. If the pattern repeats too many times, I’ll have to start over at page one. Also, the critical reading mass depends on the subject matter – the more complex it is, the more information I need to keep in my mind at the same time, and hence the more intense and sustained reading required to stay abreast.

And that is it for time. Time is pretty simple. Just make sure that the reading budget is sufficient for riding the wave. The second impediment, discomfort, is much more – uh – discomforting.

You see, a common trait among the books in the tower is that they entail learning. The challenge is that any significant act of learning involves some amount of discomfort. When learning something non-trivial, something actually worth learning, there will be resistance. There will be things I don’t understand, at least not immediately – perhaps I may need to read, re-read and re-read again in order to come anywhere near grasping it. That can be frustrating and painful.

The feeling of discomfort is amplified by the fact that my brain is getting older and a bit rusty. The neurons are behaving increasingly anti-socially, they’re grumpy and less willing to make new associations than they used to be. Perhaps they’ve been hanging out with me for too long, I may have a had a bad influence. Anyways, a less flexible brain means even more discomfort and harder work in order to learn something new.

This brings me to the scary part, which I call topic skipping. The problem is that the discomfort of reading a book that requires learning kicks in exactly when introductions are over with, and the material starts offering genuine resistance. (You’ll recall that I’ve read up to 10% of all the books in the tower.) At that point, it’s all too easy to jump ship, abandon the book, and start over with something new. That’s a pretty pathological pattern. In a way, it resembles what is known as disk thrashing; a term used to describe a hard drive that is overworked by moving information between the system memory and virtual memory excessively.

Now according to Wikipedia, that trustworthy workhorse of information that may or may not be trustworthy, a user can do the following to alleviate disk thrashing:

  • Increase the amount of RAM in the computer.
  • Adjust the size of the swap file.
  • Decrease the amount of programs being run on the computer.

In terms of reading, this translates roughly to increasing the size of your brain (a good idea, but requires significant advances in medicine), increasing the amount of time available for reading (I’d like to, but cannot conjure up any more hours in the day) and decreasing the number of books you’re trying to read at once (excellent advice!).

The main problem with both disk thrashing and topic skipping is waste. You appear to be working, but you’re really just spending your time changing topics. Given that time is a scarce resource, it makes no sense to waste it like that. It would be much better if I would just harden up, endure the discomfort of feeling stupid, and resist the temptation of starting over on some new and shiny topic.

So there you have it. Time and discomfort. That’s why I’m not reading books fast enough, that’s why reading efforts often get abandoned after the first chapter, and that’s why my stack of unread books is growing into a veritable tower of Babel. Some defense! Turns out I’m a busy wimp! I’m afraid the spotted hawk won’t be too impressed!

I still have a teeny tiny trick up my sleeve, though. I believe commitment is the antidote to both gab and loitering, and it turns out that involving other people does wonders for creating commitment. So I’m teaming up with some compatriots from work to form a book circle. First book up is SICP which, coincidentally, you’ll find residing at the top of the tower. So there is hope! Which is good, because I totally need to make room for this awesome-looking book which discusses multi-paradigm programming using an obscure language called Oz. How’s that for shiny!


To Knuth or not to Knuth

I received an email with an interesting question a while back. The question was this:

Dear doctor, should I read Knuth?

As you can see, the email was deviously crafted to appeal to my vanity – which of course was a clever thing to do, since it spurred one of those lengthy, slightly self-absorbed responses I’m wont to. However, it also triggered an unexpected chain of events which is now resulting in this blog post. You see, the flattery inflated my ego to the degree that I figured I should follow Scott Hanselman’s advice, and maximize the effectiveness and reach of my keystrokes. I am therefore publishing my response here to the vast readership of my blog. That means you, dear reader! Nothing like a bit of old-fashioned hubris!

So, should you read Knuth? I dunno.

It’s an interesting question, though, with some pretty deep repercussions. In fact, it is interesting enough that Peter Seibel included it as one of the questions he asked each of the prominent programmers he interviewed for the book “Coders at Work“. You should totally read that book, by the way.

Anyways. In case you’re unfamiliar with Knuth, we’re talking about this guy:

Knuth

Professor Donald Knuth

Knuth received the ACM Turing award in 1974 (a year before I was born) for his work on the analysis of algorithms and data structures. That work is captured in the first three volumes of a series of books known as The Art of Computer Programming or TAOCP for short. “Reading Knuth” refers to reading those books.

Of course, that’s a pretty significant argument for reading Knuth right there. The content of the books is worth a Turing award! I bet you don’t have many books in your bookshelf for which that is true. I don’t, and I have awesome books! TAOCP is the quintessential, be-all end-all resource for the study of algorithms. If you are familiar with the so-called big-oh notation for estimating run-time costs of algorithms, that’s due to Knuth’s influence.

One of the quirks of Knuth is that apparently all the examples in the TAOCP use a language called “MIX assembly language”. It runs on a hypothetical computer called “MIX”, dreamed up by Knuth. Clearly, then, the examples are not directly transferable to your day-to-day work as a programmer. And undoubtedly, it can be somewhat off-putting for modern readers to have to learn everything by means of this ancient assembly language for an obsolete machine that never existed. To be fair, Knuth has since come up with MMIX, a “64-bit RISC architecture for the third millenium” (no less), intended to replace the original MIX in TAOCP. I’m not quite sure how far the work of upgrading MIX to MMIX has progressed, though. Also I’m not quite sure that it really rectifies the situation. But YMMV.

A further obstacle is that TAOCP requires significant mathematical sophistication on behalf of its readers. It speaks volumes to me when Guy L. Steele Jr claims he lacks the mathematical background to read parts of it. What about us mere mortals, then?

These challenges conspire to raise some serious doubt: is reading Knuth worth the effort? Clearly it requires a lot of intellectual struggle and perseverance. Isn’t it simply too much trouble to go through? At the same time, the challenges contribute to a further selling point for Knuth: TAOCP as the ultimate rite-of-passage for programmers. Arguably you’ve beaten the game of programming and computers in general when you’ve read Knuth.

So then: do I think you should read Knuth? I dunno.

I feel like it’s an important question to try to answer, though. It’s kind of amusing, really – it reminds me of the opening of “The Myth of Sisyphus” by Albert Camus, 20th century French writer and philosopher. It was one of my favorite books way back when I was young and oh-so much older that I am now. I would be sitting in a cafe, reading French literature and aiming for an air of profoundness and mystery by occasionally raising my head and gazing at the world through faraway eyes. It attracted less girls than you’d think.

Anyways, the opening goes like this:

There is but one truly serious philosophical problem, and that is suicide. Judging whether life is or is not worth living amounts to answering the fundamental question of philosophy. All the rest – whether or not the world has three dimensions, whether the mind has nine or twelve categories – comes afterwards. These are games; one must first answer. And if it is true, as Nietzsche claims, that a philosopher, to deserve our respect, must preach by example, you can appreciate the importance of that reply, for it will precede the definitive act. These are facts the heart can feel; yet they call for careful study before they become clear to the intellect.

Isn’t it just grand? Who cares about girls when you can read stuff like that.

Translated to the Knuth dilemma: if I reach the conclusion that you should read Knuth, I immediately have a problem: it follows suite that I should proceed to read Knuth as well! (Indeed, how can I claim to give a meaningful and convincing recommendation for or against it without actually having read the books first?)

So then: should I read Knuth? I dunno.

So far in my career, I’ve sort of dogded the issue of Knuth and TAOCP. I’ve avoided ordering the books despite their obvious merits because I’ve been quite convinced that they would just be sitting on a bookshelf collecting dust and radiating failure. As long as I don’t actually have the books in my possession, I don’t feel that bad about not having read them. But if I were to own the books, and I still didn’t read them, I would actively have not-read Knuth. Which is clearly a lot worse. Hence I’ve backed out of the challenge thus far by cunningly avoiding purchase. But of course that has more to do with my knowing a thing or two about my innate laziness and resistance to discomfort than anything else. It’s not a good reason to avoid Knuth, but at least a truthful one.

But that’s me, not necessarily you. What about you? Should you read Knuth? I dunno.

In my mind, reading Knuth is similar to choosing to walk three years by foot to some remote location in the mountains, in order to study with some famous zen monk (a thought that is somehow made more amusing by the fact that Knuth bears a certain resemblance to Yoda). Once you’ve made up your mind to study with this monk, you don’t really question why he does things this way or that way – you just do as you’re told. Wax on, wax off, if you like.

Paro-taktsang-tigers-nest-monastery-bhutan-500x375

Taktshang – the Tiger’s Nest monastery

Of course, there is a underlying assumption that you will, at some point, become enlightened. The invisible veil that hindered your sight before (although you were not aware of it) will fall from your eyes, and everything will become clear. But you don’t ask yourself when or how this will happen. I believe this is the attitude with which you need to approach Knuth in general, and the MIX architecture in particular.

However. While I am quite convinced that you will be enlightened should you seek Master Knuth in his monastery, I am equally convinced that there are other paths that lead to enlightenment as well.

In the end, I suppose it comes down to with which monk you want to study. What are you looking for? What is the nature of the enlightenment you seek? If the answer is that you want the most profound understanding possible of how algorithms and data structures correlate with the detailed workings of the the physical machine, you should read Knuth. If the answer is something else, well, perhaps you should read something else.

For my part, I’m not sure I won’t at some point in the future, in fact, walk the long, winding, barefoot road to Knuth. First, though, I want to be a wizard’s apprentice in the school of Abelson and Sussman. There I can study the problems of calculation and abstraction free from the tethering of the underlying hardware. It seems like so much more fun, to be honest. That may be an immature grounds for making such an important decision, but there you go. I’m so much younger now that I’m older, I can afford those kinds of transgressions.