Monthly Archives: November 2011

Commit Messages

When reviewing a commit I’m not interested in what you did. A commit is a codebase transformation. I’m interested in what will happen to my codebase when I apply your commit.

Bad “I did this” form:

I had a cup of coffee, went for a walk, and changed some code.

 

Better “This commit does this” form:

Adds unmap() to the command map API.

A commit message should describe the commit, not the process you went through to create it – it is not a diary.

Posted in Uncategorized | Leave a comment

Unit Testing: Why I prefer assertThat()

Consider:

[Test]
public function null_criteria_should_not_match():void
{
  assertFalse("passing null should return false", instance.match(null));
}

When reading the test above I have to do a lot of scanning. Continue reading

Posted in Uncategorized | Leave a comment