Friday, June 15, 2007

Source Available

We've set up a web interface for browsing the git repositories that host all of Hendricks Solutions' source code. Feel free to browse around and offer suggestions for improvement. Gitweb isn't our creation, but we'll gladly convert your suggestions into patches and contribute them back to the community.

At this point, the only project of much external significance is Object::eBay. Although clk (probably known as App::Clk once released to CPAN) is interesting, it's not really ready for use outside the company. Of course, if you want to hack on it anyway, that's the beauty of open source.

Sunday, June 10, 2007

Cheap Experimentation

Computers are great for self-teaching. They allow one to experiment quickly and easily. One creates a hypothesis, tests it and learns from it in a short cycle. One example is the small wiki application TiddlyWiki. It took me about 15 seconds from the time I heard about the program having it up and running on my Desktop. When I was done, I removed the experiment with no long-term effects on my machine. The entire process to install and start TiddlyWiki was:

  • Download an HTML file
  • Open it in my browser

Although I'm not looking to set up a new wiki, that quick experiment did more to lodge TiddlyWiki in my mind than any explanation, tutorial or diagram. Now that I've seen it and played with it, my mind makes up plenty of reasons why I can't live without it. TiddlyWiki isn't the only application I've encountered lately where cheap experimentation proved its value.

Digg.com API

Earlier on this blog, I wrote an article about good web APIs. The digg.com API is such that one can experiment with it in his web browser. I can quickly and easily evaluate whether the API lets me accomplish what I want. More importantly, during experimentation, I'll think of uses that I may not envision without seeing the actual data that's available through the API.

One of my clients sells used video games. A key part of his business model is buying and selling on eBay. When the eBay API first came out this client and I were excited about improving some of his internal business processes by using eBay's new web services. When I tried to play around with the API, I discovered that they charged thousands of dollars. All of this had to happen before I could try my first API call. Needless to say, we postponed eBay integration until the API process was changed. eBay's API process is still too complicated, but they've come a long way.

The point is, if eBay had made experimentation cheaper, a faithful eBay customer would have improved his business earlier and spent two years giving eBay more money through listing fees, final value fees, etc.

Programming Languages

Other great examples of cheap experimentation are various sites that let one try a dynamic programming language from a web browser:

I don't have to track down instructions for building and installing the interpreter. I can open a webpage, type some code and see the results. Sure, I wouldn't accomplish anything grand from one of these interactive sessions, but at least it helps me decide whether I want to proceed further with the language.

Revision Control Systems

Although I used CVS for a few months, I never actually tried branch or merging with it. However, I saw enough that I trust Linus's comments that branching in CVS is quite painful. As such, it's painful to experiment with different solutions to a programming problem. In more powerful version control systems such as Subversion SVK or, even better, Git, branching and merging are easy. That ease improves productivity for a programmer.

On Thursday, I was working on a new application for a client. I spent most of the morning making good progress. Right before lunch, I realized that the implementation I chose was leading me to a dead end. Had I been using CVS, I'm not sure what I would have done, but with Git, I just did git checkout -b experiment HEAD^ and began coding in a different direction. I knew that if this new direction failed, I could easily return to what I had been working on before. If it succeeded, I could discard my failed attempt without consequence.

Which brings me to an aside. How cheap is cheap? With CVS, branching was infinitely expensive since I never figured out how to do it correctly. With Subversion, it would have cost me something like this

$ svn cp http://example.com/project/trunk http://example.com/project/experiment
$ svn sw http://example.com/project/experiment

with SVK it would have been something like

$ svk cp //mirror/project/trunk //local/experiment
$ svk sw //local/experiment

and as mentioned above, Git needed

$ git checkout -b experiment HEAD^

The energy spent typing each invocation was

SVN7.5 Joules4x Git
SVK4.2 Joules2x Git
Git2.2 Joules--

None of those invocations is especially expensive, but I've only started doing experiment branches since using Git. The expense has finally dropped below that mental threshold where the experiment is worth doing.

And thus we learn ...

I've noticed the same trend with other systems. The ones I like and use are the ones that make experiments cheap. I could bore you with virtualization or landscaping software or CPAN, but the moral of the story is make it easy for people to experiment with your product or if you're looking to create a new product it should lower the cost of experimentation in some respect.

Thursday, June 7, 2007

Web APIs without Registration

Dharmesh Shah has a list of attributes that make a great web API. I've not actually used the Digg API, but I've used others enough to sound a hearty Amen. Point #4 is my favorite, There's no registration and no key that has to be requested. Aside from making the API harder to use, registration processes discourage hobbyists from experimenting. It unnecessarily truncates the long tail that makes web services so valuable. Registration and API keys are a remnant of walled garden mentality. I prefer the lazy, trusting approach. Allow everyone to use the API assuming that they'll be good citizens. What if scoundrels cause trouble? Cross that bridge if you get there. No sense penalizing yourself and honest users because somehow, somewhere, someone might abuse your API.