Monday, January 14, 2008

I'm an Isolationist !

Isolationism

No, this isn't a commentary on geopolitical trade agreements or transaction levels. It's a simple idea that re-inspires me every few months.

Long ago, back in C++, Bruce Eckel's books taught me the importance of studying something in isolation. Write a little program: then experiment, tinker, learn.

I'm grateful for his C++ and Java books but I think that this sense of curiosity is the single most important lesson. Naturally, many developers do this -- but not all.

These days, I've been doing a fair amount of work with Hibernate, which has been a learning experience. Early on, I spent about 2-3 hours setting up a sandbox (i.e. an isolated testbed).

That was the best time I have spent in a loooong time. I might post the download to a site, but for now here is the gist.
  • Ant, Hibernate, and a text editor (I use jEdit). No IDE.
  • Tasks to build a couple of POJOs (plural for mapping associations/collections)
  • Tasks to build and run a driver program (for reading/writing/transactions)
  • Tasks to generate SQL (using Hibernate tools) and rebuild/populate the DB
  • An overall task that starts everything from scratch
This is hardly rocket science. But it has been terrific:
  • Because the sandbox is not tied to a large project, everything is ultra fast, and available during the main project's compiling and testing.
  • It is a "headful" and no more. I can return to the sandbox after a couple of days and remember what I was studying. Better yet, I can confidently start hacking on the new problem: the Ant tasks obliterate the old DB so every run is a brand new day.
  • No IDE means that the sandbox is available if the IDE is busy on your main project. Yes, you do lose code completion but, given the mindset, it's worth it.
  • Very little noise: e.g. you can enable SQL logging and actually understand the output.
  • The sandbox can be easily shared with others. Believe me, other teammates will usually ask for it, once they see its effectiveness. Any given sandbox instance acts as a type of foothold, which most developers appreciate. Most of us are independent rock-climbers: we don't want hand-holding per se, but we all need a foothold to start from. (Eric generalizes this idea for effective downloads of 3rd party libraries.)
If you encounter a new technology, Hibernate, Spring, web services -- you name it -- build an isolated sandbox. I often fall into a trap where it seems too much of a speedbump to bother, but I've re-learned that it is time well spent...

3 comments:

  1. I meant to mention that, if there is interest, I could post it up onto the website once I get the site set up (really soon now).

    Contact me via email if you'd like a faster delivery time.

    ReplyDelete
  2. Running light without overbite, are we? Thanks for the reminder, one of my biggest problems is how easily I forget.

    ReplyDelete