Archive for November, 2008

The Bedside Reading Pile Revisited

Monday, November 24th, 2008

It’s been a year and a half since the last snapshot of what I’ve been reading. Since the pile is threatening to fall over again, now is a good time for an update.

Bedside Books 11/08

The only active book in the pile is Algorithms in a Nutshell. It’s a good refresher on how to analyze algorithms, but isn’t a broad survey.

Lea’s Concurrent Programming in Java and Bloch’s Effective Java (second edition) came off the shelf a few nights ago so that I could refresh myself on multi-threaded programming in Java. (I’ve since ordered the second edition of Lea’s book, since a few useful things like java.util.concurrent have happened since the first edition.)

Poppendieck’s Lean Software Development: An Agile Toolkit came off the shelf last week for a reference check on Value Stream Mapping. If you’re an Agilist who hasn’t yet read any Lean literature, this is a good place to start.

The only book in the pile that I have any issue with is jQuery in Action. There’s a trend in technology references books toward lighthearted prose. In this case, I thought that wit and humor got in the way of clear, unambiguous writing. Still, it’s a good introduction to an awesome JavaScript framework.

Michael Feather’s Working Effectively with Legacy Code has been cycled in and out of the bedside pile several times. I highly recommend it if your life takes you near large piles of code that you didn’t have a hand in creating.

Tom Vanderbilt’s Traffic: Why We Drive the Way We Do was an insightful read, with interesting parallels to software development. I’ll have more to say about that later.

Crockford’s JavaScript: The Good Parts is worthwhile if you do any work in the browser and find yourself swearing at JavaScript. Crockford sketches out a safe subset of the language. You’ve got to love a book that has appendices named “Awful Parts” and “Bad Parts”. And if you’re doing web work and don’t know about the various cross-site scripting vulnerabilities, stop now and get a copy of Foundations of Security: What Every Programmer Needs to Know. It’ll give you a good scare.

As evidence that I actually do read fiction, there’s Terry Pratchett’s Making Money, a fun read that explores the philosophy of the Gold Standard as it evolves into something else on Discworld. That one goes near the bottom of my top ten favorite Pratchetts.

Near the top right are several lateral thinking and math puzzle books that I got to keep the family occupied during some long plane flights this summer.

There are two management books in the pile, even though I’m not managing right now. It’s a hard habit to shake off.

The only unread book in the pile is Peter Walsh’s It’s All Too Much: An Easy Plan for Living a Rich Life With Less Stuff. Recommended by several friends. I’m kind of worried that my “stuff” includes way too many books.

Java Concurrency

Monday, November 24th, 2008

The need to write multi-threaded code rarely comes up in my corner of the world. And I know from the admonitions of far better programmers than I that if the need to write multi-threaded code does arise, it is best to tread very, very carefully. But when a Java concurrency problem came up last week, my reaction went beyond being wary. I was unsettled at a gut level. Rather than treading forward with care, I backed away.

My first after-the-fact reaction was, “What the heck was that about?” followed by “That won’t do. That won’t do at all.” It was time to hit the books. I read the chapter on Concurrency in Effective Java (second edition) that I’d previously skipped. And I dug up my old, first edition copy of Doug Lea’s Concurrent Programming in Java. Notes in that book showed that I’d only made it halfway through.

Later, while walking the dog, my mind wandered and I remembered why I’d only made it halfway through Lea’s book. I’d taken it on vacation for airplane reading. Mid vacation, I wasn’t feeling well, so I crawled into bed early, taking the book along. Then, on page 168, the stomach flu hit and I started puking my guts out. Two days that could have been spent on a tropical beach passed most unpleasantly. That was eight years ago. I didn’t open the book again until this weekend.

So I wonder: Could that experience have imprinted a strong, negative association with Java Concurrency? There are precedents. After getting food poisoning from a freeze-dried Mexican meal while backpacking (and then having to hike 10 miles over a mountain pass to get back to the car), the smell of the spice cumin turned my stomach for nearly 15 years. And there was the unfortunate incident that has left me unable to get within smelling distance of Canadian Whiskey without getting queasy. Could the same effect apply to ideas? There are plenty of psychology experiments that show what a few well-timed electric shocks can do to anchor avoidance behaviors. Violent regurgitation at the right moment could probably have the same effect.

Fortunately, negative associations can be overcome. In this case, it means spending some quality time with multi-threaded code, some good music, and maybe a nice cup of tea and some cumin-free cookies.