Mar 21
Currently I’m reading the book Extreme Programming Explained: Embrace Change (2nd Edition). If you think it’s just the first edition with a little extra, you are as wrong as a failed unit test. Kent Beck pretty much rewrote the book. Some of the new ideas and practices are very close to what I observed through my own experience. Some of them are brand new to me. I’ll talk about one of them here and others later.
Shrinking Team
The idea is that you don’t keep everyone in the team 100% busy. Leave about 70% of one person’s time free. Then let the team work on improving its process until it doesn’t need that one person any more. The team keeps shrinking this way. Later on, if the team has more work than it can handle, merge two small teams together to form a new team.
Now, even Kent Beck himself admits that he’s never tried this in a real project. He just borrowed it from the Toyota Production System. I don’t see it working the exact way he described either. At least I don’t want to be the “extra” person on the team. No, I’m just kidding. That’s not what the practice is about. Keeping a team running full load is definitely a good thing. That’s exactly what happened for the last six months in our project. We are so busy implementing stories and fixing bugs that we don’t have time to think what we can do better. Sometimes we don’t even think about what we are doing. The end result is a lot of duplicate code. Code that hasn’t been thought through. But now it’s too late to change it and I’m not the person that could have made the change either. Let’s just hope things will get better after the first release.
Mar 16
Have you ever used TreeSet in Java? Let’s say we have a class called AClass. It only inherits from Object and doesn’t implement any interface. Now I want to use the following code snippet to add a collection of AClass to a TreeSet:
TreeSet treeSet = new TreeSet();
treeSet.addAll(listOfAClass)
What happens when you run this piece of code? You get a ClassCastException! Why? Because if you don’t supply a Comparator to the TreeSet, it by default thinks that the element you are adding implements Comparable. It just blindly tries to cast whatever you put in it to Comparable. This is not very nice, is it? Shouldn’t it prevent me from adding element that’s not Comparable in the first place? Exception should be part of the interface. Yes, there is the API and source code I can look at. But in the world of code completion, people rarely do that. An appropriate exception would have been a lot better.
Mar 09
This guy from ThoughtWorks has some great insights and techniques about unit testing in Rails. Read this article to find out how to divorce Rails unit tests from database and use mock instead. I’m glad to know I’m not the only one who thinks that Rails by default is way too database centric.
Mar 08
About a month ago, the Spanish company, FON, was giving away 2000 free wireless routers across Canada. In case you don’t know, FON is the company that claims to have the largest WiFi community in the world. To get the free router all you need to do is joining their community and sharing a little bit of your bandwith with other people. I signed up for one just for fun (it’s a free router, right?). Got the router this Monday. It turned to be a very cute little thing (that’s not my hand by the way).

Small as it is, it has a very unique feature: two SSIDs. One unsecured for public access and one secured with WPA for private access. Very thoughtful. You can also specify how much bandwidth you want to share. If you go to their website, you can see where all the registered routers are including yourself. The following screen cap shows where I am. Well, it’s about a couple of blocks off but close enough. The big green circle is supposed to show the coverage and last activity and the little orange dot is where I live.
