TDD: Time and Commitment

I discovered TDD somewhere around the beginning of 2005 (I have always been somewhat of a late-comer). I started with Kent Beck's book and then read the Pragmatic Programmer's offering shortly after. It struck me right away that TDD is not something you consume; you need to learn how to do it. It takes commitment. More than anything, it takes practice. It forces you to look at programming in a completely new way. And that can be a difficult transition. At least that has been my experience. However, I think that it is worth the struggle and, in my mind at least, I know it is the right thing to do.

It's detractors remind me of the same folks that say things like "OOP doesn't work". It's not that it doesn't work, it's that the tooling doesn't mitigate the fact that you have to use your brain and invest some time and effort into learning how it all works. It's like someone who buys a guitar for the first time and says, "Guitars don't work" as they throw it away a few days later.

The point is, I have been investing in TDD and I am starting to reap the benefits of my investment. I am by no means a master but I think I could at least hold my own in a TDD street fight.

TDD says that my designs will become more testable; unit tests are a nice side-effect. I am really starting to grok this on a whole new level and wondering how far I can go with all of this.

From the War Room: Pedal-powered Laptop Charger

I work in a room with two other people. Besides talking about things like the historical precedent for using i in for-loops and various patterns for utopian societies and what not, occasionally a good idea pops up. This time from my co-worker, Chalice. She is a Rice graduate, so we take her very seriously. Her idea: given that the world views programmers as lazy people who sit around in chairs all day long and the fact that we are all on laptops, oh, and global warming, wouldn't it be cool to have a pedal-powered laptop charger? You just plug it into the laptop and throw it under the desk. I figure the thing would also need to plug into a USB port to communicate with a utility of some kind that could report "calories burned" and other such things. Not only would you get free power for the laptop, you get ripped in the process.

Now this is just one of the million ideas that come my way that I will never act on, but I package it up for you, so that you can bring it to fruition. This is exactly what I did in the mid-80's when my step-dad invented Netflix at dinner. But that's how I roll. I come up with ideas and I come across ideas. I pass the ideas on to you for big savings.

Go register codegreener.com right now. As of today, it seems to be available. Put up some kind of Web 2.0 site with rounded corners and a silly logo and watch as your till overfloweth with wholesome bounty. Seriously, you could probably find plans for a hand-crank charger on Make and modify it for bicycle pedals.

Audio Computer Books

That's right, you heard me. A-u-d-i-o computer books. No, I am not talking about some guy reading code listings here. I am talking audio for all the fluff parts of the book like the preface, overview, theory and whatnot's. You see, I learned something recently. I retain more when I hear something than when I read it. Seriously, I have listened to all seven books of Stephen King's Dark Tower septology, and I still remember the most minute details from all of the books. Who is Zoltan? What you don't know?

So, I think it would be great to put all the talky stuff from a computer book on a CD, then have it refer to the papery parts which would contain code listings and things better expressed with pictures. I sent an email to one of my favorite publisher's who I won't name (Gary Cornell at Apress) and so far I am hearing nothing but chirping crickets. It's disappointing, too, because I know it would work. Plus, I need stuff to listen to when I am driving to and from work. With the pace of life what it is these days, who doesn't want to reclaim all of that wasted driving time. If I could spend that hour and half learning about such awesome, spine-tingling topics such as "Business Intelligence with SQL Server 2005"...I mean, wow. Just wow.

Implementation Patterns: Code that Reads Like a Book

I just finished reading Implementation Patterns by Kent Beck. It's not really what I had anticipated but I did enjoy reading the book over the Thanksgiving holiday. It has the one quality I like in a computer book: skinniness. All frap and no crap. The first sentence of the paragraph pretty much sums up the book:

This is a book about programming - specifically, about programming so other people can understand your code.

Kent (for some reason I feel that we are on a first name basis) says that our code is read more than it is written. Knowing this, we should keep the reader foremost in our hearts and minds. And as Donald Knuth says...

knuth

You know, I could not agree more. And that's not because I automatically believe everything he tells me either. All though I am inclined to, I admit.

A few years back when everyone was coming out with their own (slick term here)-Driven Development genres, we coined the term Maintenance-Driven Development to express this idea. Our credo: Never trust an architect that doesn't code or a programmer who has never had to maintain someone else's code. You have to have felt a certain kind of pain to really understand why this perspective is valuable, I think.

Simply put, what are the people who are maintaining this application going to think when they look at this code? Will it make sense? Will it "read like a book" and tell the story it needs to tell? This is very powerful stuff and Kent really drives this point home....then he talks about a lot of other stuff.

But the short of it is there are many good tidbits in this book. I do think it is aimed for the novice to neophyte codeslinger, however, I think that IP and and Refactoring together make nice companion volumes on any bookshelf.

Martin Fowler Working on DSL Book

Martin Fowler is working on a book on Domain Specific Languages. He has posted some material online and provided a feed for those interested in getting progress reports. In his words:

My current vision for the book is a Duplex Book, split into a section of narratives and a (larger) reference section of topics. At the moment most topics are in pattern form, but I don't expect this to be necessarily the case as I flesh them out. Reference items in parenthesis are just placeholders for material that I'll be writing later.

Programming in the Car

The other day I realized that I waste about two hours a day in the car going to and from my job. Even with vacation, that's easily over 300 hours per year. Typically, I listen to talk radio (I tried learning Spanish and Russian, but the harder the lessons get, the harder it is to pay attention and drive at the same time) but I have come to realize it is doing nothing for me except make me lose faith in humanity. At the end of the day, what have I gained from the experience? Not much.

The world of software is so enormous and there are so many things I want to learn. I am always scheming on how I can learn more with the time allotted to me. I

don't know why I never thought of it before, but there are several really good podcasts available these days.  I have listened to podcasts before, but for some reason I never thought about burning them to disc to listen to them in my car.

Anyway, here's are a few that I have found recently:

OOPSLA 2007 Podcasts
Software Engineering Radio
Agile Toolkit Podcast
Pragmatic Programmers

I am going to be on the hunt for more good podcasts. Hopefully, I can subscribe to enough of them to fill my morning drive.

I think it would be rather cool if computer book publishers would do audio books. Nothing in depth, of course. The idea of someone reading code sounds hilarious and all, but I was thinking more high level. A developer-centric overview of some topic (take your pick), for instance. I have recently discovered that I actually retain more by listening to something rather than reading about it. Plus, there is all kinds of time that you could devote to listening to the stuff...when you are driving to work, working out, buying groceries, etc.

Typing "audio computer books for blind people" into Google accomplished absolutely nothing. So, I think I have discovered what could be a wildly hot new niche market.