Monthly Archives: August 2008

Too much choice

Barry Schwartz wrote the book The Paradox of Choice: Why More Is Less more and gave this TED talk on why too much choice can be a bad thing.

To summarize, too much choice is bad when:

  • It paralyzes decision making because you fear making the wrong choice.
  • You recalculate the benefit of your choice by subtracting the benefits of the choices you didn’t make (i.e., subtracting the opportunity cost).
  • Choices leads to escalation of expectations.
  • You blame yourself for not making the right choice (if you didn’t have to choose then you couldn’t be blamed for making the wrong choice).

A couple months ago I signed up to do the Hood To Coast relay run, which is next weekend.  I’m running with a really well organized and experienced team.  The team captains are taking care of all the organization, pretty much all I have to do is show up and run – so this is a fantastic opportunity!

However, since I signed up for the run I’ve had some regret because I’ve discovered I’m missing out on several other things (the company picnic, the first Chinese class of the new semester, an annual 100 mile cycling event, and watching the last couple of days of the Olympic games).  Why should having all these options available reduce the benefit of my decision to do the HTC run?!  Except for missing the class, none of the other options would even remotely be valid reasons for not doing the run!

Thanks to Barry, I now understand why I feel a little bit of regret, even though I shouldn’t.  However, in his TED talk Barry didn’t say what I should do about it…  it’s not unlike Daniel Gilbert, who explains in his book – Stumbling on Happiness – why we are often unhappy about our choices, without really explain what to do about it!

My /dev directory layout and environment setup

This article describes the directory structure and command shell environment configuration I use on my development machine to help manage tools, source code and dependent libraries.

Directory Layout

On Windows I keep all my development tools and source code under c:\dev.  On Linux I use the same layout under $HOME/dev/

Inside the “dev” folder I have the following sub-directories:


/tools – contains executable application, tools and utilities, like Eclipse, DbVisualizer, Tomcat, Maven, HSQLDB, etc.  I only place tools here that you can install manually simply by unzipping them (for example, Ecipse, Maven, Tomcat).  For the tools or applications don’t ship in a zip file but only come with installers (for example, Java, Oracle, TortoiseSVN) – I let these tools install to their default locations (for example, under “C:\Program Files” or  “/usr/local/”).

/lib – contains binary distributions of 3rd-party libraries and documentation, like GWT, JUnit, SpringFramework, Hibernate, etc.  These days this directory is actually pretty empty – since I now mostly rely on the Maven to download 3rd party libraries and store it in the local Maven repository.  However, it is still sometimes useful or necessary to have the documentation and examples handy.

/os – contains source code for 3rd-party Open Source libraries and tools.  I also use it as a sandbox for unpacking and executing 3rd party sample code.  The entries here are usually transient.

For example, on Windows I have:


I also place my own source code projects directly under “dev”, for example:


BTW, “spikes” is a nice “catch all” place for trying new things out before moving them into “real” projects. Even though “spikes” only contains throwaway or proof-of-concept code, I tend to commit the contents to a SVN repository. Some people use the term “sandbox” instead of “spikes”.

Shell Environment Configuration

To set up my environment variables I create a command file in the “dev” folder – usually called “setenv.cmd” on Winows and “” on Linux.  The file sets up the path, environment variables, and on Linux it also sets up aliases.

On Windows I find it far more convenient to manage the environment settings through a command file rather than going through the Control Panel (System > Advanced > User Profiles > Environment Variables) dialog.  It’s also very useful if to set your environment through batch files if you sometimes need to run a different versions of a tool (for example, if you use Java 6 for new projects but sometimes have to run Java 1.4 for legacy projects).

This is an example Windows setenv.cmd file:

SET JAVA_HOME=c:\Progra~1\Java\jdk1.5.0_14
SET ANT_HOME=C:\dev\tools\apache-ant-1.9.0
SET CATALINA_HOME=C:\dev\tools\apache-tomcat-6.0.14
SET DERBY_HOME=C:\dev\tools\db-derby-
SET SPRING_OSGI_LIB=C:\dev\os\spring-osgi-1.0-rc2\lib

@echo off

SET PATH=%PATH%;C:\dev\tools\apache-maven-2.0.9\bin
SET PATH=%PATH%;C:\dev\tools\putty
SET PATH=%PATH%;C:\dev\tools\apache-ant-1.7.0\bin
SET PATH=%PATH%;C:\dev\tools\bnd-0.0.238
SET PATH=%PATH%;C:\dev\tools\db-derby-\bin
SET PATH=%PATH%;C:\progra~1\Subversion\bin

echo on
echo PATH=%PATH%