Monday, July 30, 2012

"Team Geek" by Brian W. Fitzpatrick and Ben Collins-Sussman; O'Reilly Media;

Brian Fitzpatrick leads Google's Data Liberation Front and Transparency Engineering teams.
Ben Collins-Sussman is one of the founding developers of SVN and now manages the engeneering team for the Google Affiliate Network.
Both have a lot of experience with Open Source Projects.

The Book has a clearly defined goal - to help programmers become more effective and efficient at creating software by improving their ability to understand, communicate with, and collaborate with other people.
And that is the essence of this book. It explains why each relationship (not only related to Software projects) should be based on Humility, Respect and Trust (HRT).

The message of the book also applies to the relationship between team mates, team leader and team and above all to the relationship with end users. The book gives useful tips on how to cope with complicated team mates and how managers should lead their team.

Brian and Ben explain why a team culture is so important and should be protected right from the start. Last but not least the reader gets some tips on how to promote himself better within his company. I really enjoyed reading this book.

Book catalog page

Tuesday, July 17, 2012

List<T>.BinarySearch Pitfalls

The BinarySearch Method of List collection can be very useful to get the zero-based index of an element.
Further more if the element you searched for is not in the List you can calculate the index of the first element that is larger then the element you searched for. Just apply the ~ operator on the result of the BinarySearch:
var pos = aList.BinarySearch(aString);
if (pos < 0)
{
    aList.Insert(~pos, aString);
}

But there is one pitfall: The List must already be sorted; otherwise the BinerySearch result is incorrect.
This is not a big secret. It is clearly stated in the MSDN description for the Method (under Remarks)

I saw a Bug in a Project where someone used a BinarySearch to find duplicated entries between to Lists. This works as long as the Lists are sorted. If not the result is totally nonsense.
It took a while to find this Bug.
MSDN Link:
http://msdn.microsoft.com/en-us/library/w4e7fxsh.aspx