Books
Books
I've just started reading Michael Feathers' Working Effectively With Legacy Code. One of the points that Mike makes at the start of the book is the impact that the fear of changing code has in degrading the quality of design -- specifically, how this fear is heightened in areas of high code reuse. Developers working on complicated legacy (aka untested) code engage in what he calls cheekily calls Edit and Pray.
At ThoughtWorks, I get to read a lot of code from different sources: code submission are a part of our interview process and, as a consultant, I've moved between a variety of different projects. One common code smell is long methods. This always struck me as odd as the advantages of small methods seem readily apparent. I previously chalked this up bad habit up to laziness or inexperience or lack of adequate tool support; however, reading Mike's book has given me a different perspective:
Many people regard introducing methods primarily as a form of code reuse (rather than as an aid to readability). Reused code is code that is scarier to change because it is much harder to tell what the impact is of changing it. On the other hand, when your code is all in one long method, it is clear from the scope that the code can be used in that method alone. Therefore, the fear of changing potentially reused code can be a disincentive to introducing new methods (especially in languages without access modifiers). I don't know if any of the writers of these long methods actually think this way, but it is an interesting perspective.
I can't remember how I stumbled across it, but in my meaderings through the web I came across Laurent Bossavit's
Bookshelved wiki. Bookshelved is essentially a forum for recording and discussing books that you are reading. It is interesting to see who's reading what, and it's a great source for new book recommendations. So, this is what's currently on my
bed side table.
I have just finished Margaret Macmillan's Paris 1919, a fascinating account of the Paris peace process that followed World War I, culminating in the Treaty of Versailles and the founding of League of Nations. The Allied negotiators found themselves taking on the herculean task of trying to "fix the world", resolving the boundaries of all those nations that were drawn into the conflict. The decisions that they made have shaped much of the world today, and contingently contributed to many of its recent global conflicts: from the four Balkan wars of the 90s, to the civil war in Lebanon and the ongoing Palestinian conflict. Most pertinently, the peace process had the dubious distinction of drawing the borders of modern Iraq (at time, the British protectorate of Mesopotamia). Macmillan ominously described this decision:
In 1919 there was no Iraqi people; history, religion, geography pulled the people apart, not together. Basra looked south, toward India and the Gulf; Baghdad had strong links with Persia; and Mosul had closer ties with Turkey and Syria. Putting together the three Ottoman provinces and expecting to create a nation was, in European terms, like hoping to have Bosnian Muslims, Croats, and Serbs make one country.
With this as the basis for constructing a nation, it hardly bodes well for the future of a new "independent" Iraq.