A few months ago I wrote a review of the Who is Agile set of interviews compiled by Yves Hanoulle. Time has passed now as Yves has been back in touch and as the book has evolved I'm writing this follow up.
I think that any community has its fair share of navel gazing and it seems that the agile community suffers especially from this. Too often the Agile manifesto's signatories are put up on pedestals and listened to without question. Too often are practicioners sat around telling each other "didn't we do well". When I first came to read "Who is agile" these were the biases that I was laden with and consequently I had some reservations of the underlying purpose of this book and the value that it would bring to those not in the circles of the contributers. I also think that this behaviour is why there are such strong opinions still over agile and I think that some of the criticism is valid.
(It's probably worth reflecting on at this point that this cynicism may be saying more about me that it is about any community)
So inspite of the review Yves has continued on with adding to the book and I've continued to read it.
After grumpily dismissing the format I think I've now think I've worked out at least one way to read it. This book is not about names, nor agile. It's a book about people. If you forget the names and bio bits and just read the questions and answers you get a fantastic insight into how these people tick. Some of the best interviews are where the interviewees talk less about software development and more about the other stuff that defines them. I believe in that to be a good software developer you need to have experience in other 'stuff'. Some stories are very personal too and it's fascinating the influence that some of those incidents have on those people.
I normally read the book on the kindle but that is only half the fun. As the book has become to big to email to the kindle (via gmail at least its > 20mb) I've found I read it less but when I do there's added value. Each interview is scattered with lots of hyperlinks, some go to just some strange places, others infomative distractions, or just plain definitons. You could get lost for hours just reading through some of the links and if you are stuck for ideas for books each interview will suggest a new one. This is really Who is agile's strengh. It's a cornucopia of information! (or a yak-shaving utopia).
The other criticism I had originally was that the book had a narrow geographical focus. Yves has done well by getting a more diverse (geographically) set of people. Yes the book still is predominatly a euro-us set of interviews but there's more from futher a fields. This feels more like a truly diverse publication.
I'm impressed with how the book has progressed. For its current minimum price ($9.49) there is so much in there. Don't be put off it you don't know (or like) agile. This is not an agile book, it's a book full of stories about software people.
Wednesday, July 25, 2012
Monday, July 23, 2012
The evils of auto properties & object initializers in c#
I've been thinking a little bit about object orientation recently. It seems that OO was the poster child of the 1990s and has been the leading paradigm through the first decade of the new millenium. The thought behind this was that object reuse would solve all our problems but in reality they didn't. Even with languages gaining objects, C evolves to C++, and being built with objects from the ground up such as Java and C# people still seem to just not get it.
Back in OO school I learnt that objects should be polymorphic, inheritable and encapsulate discrete bits of behaviour. In OO college I learnt that we should strive for low coupling between our classes and high cohesion. In OO university I learnt about the SOLID principles and that I should favour composition over inheritance. It's been a long journey and I'm still on it but all over I'm still seeing non OO code in .NET all over the place. Is OO too hard for people? Or is just a broken paradigm?
Well my friends, OO is hard but I don't think the C# language designers have helped. The two worst features for Object Orientation in c# are auto properties and object initializer syntax. "What?" I hear you say, "Auto Properties? But they're so useful! (and cute). Object initializers they save so much time!"
They are evil.
More and more I'm beginning to see classes like this:
and initialisation like this:
People are abandoning the general principles of object orientation. We are exposing the internals of our objects with gay abandon. This is a dark route that inevitably leads to pain. Every time you use a vanilla auto property you are introducing an opportuntity for coupling, which reduces the modularity and resue of your code. Your classes becomes mutable so lose all the goodness that immutability brings. By allowing 'Children' to be initialised in this way you break the Principle of Least Knowledge and couple your class even further. It's no wonder that we can't do OO if we take short cuts like this. Now of course there are reasons for using initializers, simple DTOs and anonymous classes spring to mind but don't be fooled by this syntactic sugar, it will rot your teeth!
Back in OO school I learnt that objects should be polymorphic, inheritable and encapsulate discrete bits of behaviour. In OO college I learnt that we should strive for low coupling between our classes and high cohesion. In OO university I learnt about the SOLID principles and that I should favour composition over inheritance. It's been a long journey and I'm still on it but all over I'm still seeing non OO code in .NET all over the place. Is OO too hard for people? Or is just a broken paradigm?
Well my friends, OO is hard but I don't think the C# language designers have helped. The two worst features for Object Orientation in c# are auto properties and object initializer syntax. "What?" I hear you say, "Auto Properties? But they're so useful! (and cute). Object initializers they save so much time!"
They are evil.
More and more I'm beginning to see classes like this:
and initialisation like this:
People are abandoning the general principles of object orientation. We are exposing the internals of our objects with gay abandon. This is a dark route that inevitably leads to pain. Every time you use a vanilla auto property you are introducing an opportuntity for coupling, which reduces the modularity and resue of your code. Your classes becomes mutable so lose all the goodness that immutability brings. By allowing 'Children' to be initialised in this way you break the Principle of Least Knowledge and couple your class even further. It's no wonder that we can't do OO if we take short cuts like this. Now of course there are reasons for using initializers, simple DTOs and anonymous classes spring to mind but don't be fooled by this syntactic sugar, it will rot your teeth!
Tuesday, June 12, 2012
Source Control
I was just asked about source control by a friend that has only had experience in VSS. Thought I would share my rant:
Git (and other DVCSs) are a revolution in source control. They really are. Honest. I'll come back to why later but lets concentrate on what you know, VSS.VSS has a very bad reputation nowadays. This is primarly because vss is known for corrupting its repository (http://www.codinghorror.com/blog/2006/08/source-control-anything-but-sourcesafe.html) but also because of its concurrency strategy, lock-unlock-modify(http://svnbook.red-bean.com/en/1.7/svn.basic.version-control-basics.html#svn.basic.vsn-models.lock-unlock) which has gone out of fashion. Most VCSs (e.g. svc, cvs) use copy-modify-merge(http://svnbook.red-bean.com/en/1.7/svn.basic.version-control-basics.html#svn.basic.vsn-models.copy-merge) because this allows more developers to work on the same bit of code at the same time. This strategy is great but the risk is that you get problems when you merge. Obviously you get conflicts when you are merging in code into a different version of a file of the code you;ve checked out but some people keep whole versions of the codebase unmerged for extended periods of time. These can be versioned as well and are know as branches.The rational behind branches is sensible. If you have major project N that is going to be being built for 6 months then you will want to a) keep it in source source control b) not have it messing up the code you are maintaining. So a 'branch' of the code is taken and you have the benefits of source control. the trouble comes when merging the branch back in quite often the code is so divergent that you have to do a lengthy and risk prone re-integration. (funny thing is that VSS has these integration problems too). Lot's of people more clever than me have struggled with this http://accurev.com/blog/2012/03/07/avoiding-merge-hell/ , http://martinfowler.com/bliki/SemanticConflict.html . Anyway the bottom line is that merging is hard in many vcs's.The other issue with traditonal VCS's is that they make commits something you do rarely. In a normal VCS you commit to a repositroy only when you are finished. This goes against the meme 'commit early and often' http://www.codinghorror.com/blog/2008/08/check-in-early-check-in-often.html . Wouldn't it be great to create check points when you've finished a bit of code? Or if you just wanted to hide something somewhere? Also what happens if you want to share you codebase with 2 or more servers? Well in step DVCSs.Distributed Version Control Systems such as Git, Mercurial (also known as hg) make the repository local. So you can have your own personal source control system on your own machine. This means you have all the benfits of a VCS locally. if your server goes down, you have the code. If you make a mistake, you can rollback. It's awsome and it promotes commit early and often. Git is even better because you can branch really easily and mor important merge really easily so all this merge hell that occurs with other systems is lessened (if you use it right). You can pull code in form as many sources as possible and push up to them and every thing. Git is so horrendously powerful that you can rewrite commit history, cherry pick commits. This is also dangerous too. (with great power come great responsibiltiy). It also means there's a crap load to learn. Also for windows you have to use a linux shell and the tools are best used on the command line. This also is a shock to windows devs. Luckily github has brought out a windows client that makes the experience more palatable. In short Git is much, much better than any other VCS I have used despite its learning curve.i've not mentioned TFS. It's basically VSS next but with a CI server and an issue tracker built in. Its fukcing awful. Read this article and comments:
I've usedVSSSVNStar teamTFSHGand Git in anger. SVN,HG and Git are the only ones I'd return too. SVN just looks like a dinosaur compared to the other 2.Hope that helps.
Subscribe to:
Posts (Atom)