Insights and outlooks on software development

S'true

On Agila Sverige 2009

Tuesday, May 26, 2009 by Thomas L

I'll be holding a lightning talk at the conference Agila Sverige 2009 (June 8/9), having the topic "En lättviktsmodell för gradering av agila team och organisationer" ("A light-weight maturity model for agile teams and organizations"), coindidentally the same topic as this blog post.

From the looks of the program, the conference will be great. I hope to see you there.

On Default Behavior

Sunday, May 24, 2009 by Thomas L

Fred writes on A VC about default behavior on the Internet, the fact that you tend to go to a special site when you want to do something, like always going to Amazon (or in my case, Adlibris) when you want to buy a book; read the blog post for more information.

Yesterday I was going to look for info about JBoss' new JRuby appserver Torquebox, and instead of pointing my browser to Google I pointed my browser to search.twitter.com instead. Google is going to have loads of trouble with competition from real-time searches.

On getting started with git & github

Saturday, May 16, 2009 by Thomas L

More or less notes for me: this is what you need to do to clone a repository hosted on github.

What is git? Watch e.g. this video.

Install git

There are installation packages for Mac and Windows, install either of those.

Configure git

Since git needs your name and e-mail address for everything, we have to add it to the global configuration. Run the following commands
git config --global user.name "Your Name Here"
git config --global user.email your@email.com

Get a github account

Not that much to say about this.

Generate ssh keys

In a terminal (Mac) or the git bash (Windows), run
ssh-keygen -C "your@email.com" -t rsa
to generate ssh keys for you (use the same e-mail as you added to the global git config). This will place to files in the ~/.ssh folder; id_rsa and id_rsa.pub. The id_rsa is your private key, and the id_rsa.pub is your public key. This means that you should give your public key to github, and when you do anything with github, your private/public key pair will guarantee that you are you. Let's continue with that.

Upload your public keys to github

This can be done in the account management interface. You should add one public key for each computer that you use against github. The entire contents of the id_rsa.pub should be added (including e-mail addresses etc).

Clone a repository

Now everything should be set to start using github. In a terminal/git bash, run e.g.
git clone git://github.com/ironruby/ironruby.git
This will clone the IronRuby sources so you have it on your computer, and can start committing to the project.

On Tribes

Thursday, May 14, 2009 by Thomas L

If you run a company, are your customers your customers or are your customers your tribe?

On configuration

Wednesday, May 13, 2009 by Thomas L

This weekend I looked into the Spring MVC framework, and got a bit disappointed with the vast amount of XML configuration that was needed to create a simple starter application.

Then I stumbled upon Apache Camel earlier today, and got a bit happier from the possibility of easy configuration in the Java world.

First, the XML config;

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
  <route>
    <from uri="direct:start"/>
    <loadBalance>        
        <roundRobin/>  <!-- This only support for Camel 1.5 -->
        <to uri="mock:x"/>        
        <to uri="mock:y"/>       
        <to uri="mock:z"/>                 
    </loadBalance>
  </route>
</camelContext>

This is of course horrible; I suppose that the amount of XML for a moderately-sized application would, if printed, fill a binder. (And why is the <roundrobin/> placed where it is? Should't it be an attribute of the loadBalance element?)

Then the Java fluent builder;

from("direct:start").loadBalance().
roundRobin().to("mock:x", "mock:y", "mock:z");

This is much better. It's quite readable, at least if you can read Java. However, the structure of the configuration, that we can understand quite easily in the XML case, is lost.

This issue is fixed in the Scala DSL;

"direct:a" ==> {
  loadbalance roundrobin {
    to ("mock:a")
    to ("mock:b")
    to ("mock:c")
  }
}

We get a structured and free-form configuration at the same time. It's readable for me, who have quite limited Scala knowledge. My only issue right now is the curlys. I like the way the DSL uses pattern matching in Scala ("direct:a" ==> {...}) fits into this.

If I'd do it in Ruby, I could imagine it something like this:

configure "direct:a" do |route|
	route style :roundrobin
	route to "mock:a" "mock:b" "mock:c"
end

Readable, structured and sweet.

On MonoDevelop on OS X

Thursday, May 7, 2009 by Thomas L

Miguel de Icaza recently posted that the Mono project has created an executable of MonoDevelop for Mac OS X. I took a test run:

ASPNETMVC_mono_on_mac

Thumbs up!

On Working Effectively with Legacy Code by Michael Feathers - a Micro Book Review

Friday, May 1, 2009 by Thomas L

feathers_legacycodeSince I like the Micro Book Review format, I thought I should write one as well. My reading of it has been a bit interrupted, since I've been reading it for at least 4 months with other books in between, but I've recently finished reading the book Working Effectively with Legacy Code by Michael Feathers.

What this book is about

The book is on how to transform terrible legacy code into something a bit more testable and thus maintainable. The book is divided into three parts (making it a triplex book à la Fowler's DuplexBook): one introductory part on Feathers' theories behind code change; one part which deals with specific use cases, e.g. "I can't get this class into a test harness" or "My application is all API calls"; and the last part, which is a catalog of dependency breaking techniquies (i.e. refactorings), like "Sprout method", "Extract interface" or "Pull down dependency".

What I've learned from this book

  • The concept of a Seam, which is a part in the code where we actually can introduce dependency breaking techniques. I hadn't thought about that aspect of test-driving code.
  • It started me thinking about testing non-object oriented code.

What I didn't like

  • Since Feathers has to be thorough in explaining his trail of thoughts and actions in the middle part, it gets quote long and wordy. I ended up skimming through some parts of this.

Should you buy this book?

Yes, this is a 5/5. Someone said "sprint 2 is the first maintenance sprint", which is a bit aggressive, but correct to some degree. If you have the techniques in your hands and mind, you can create code with extensibility points along the way, and thus working in an Agile fashion.

Who should buy the book?

Developers and Architects will reap great benefits from this book.

On Micro Book Reviews

by Thomas L

A while ago I stumbled upon the Micro Book Review format (and recently spent 30 minutes trying to find it), and I have to say that like it. A lot.

The format is very Zeitgeist-y, in the days of Twitter, ADD and techno-stress, and has two definite advantages compared to regular lengthy book reviews for me.

Firstly it is easier to read, which means that I quite quickly can read a review. If the review tickles my fancy, I'll start investigating the book.

Secondly it is easier to write. Since I don't have the attention span for writing a lengthy book review, I can use the Micro Book Review format for a quick hack and carry on with other things.

Now I'm waiting for the Nano Book Review format, which of course has to be in less than 140 chars to be twitterable.

(Image credits)