First day of XP2011 Conference was held in Madrid 10th May. It was a day full of morning and afternoon workshops and tutorials, so I had to choose carefully among all the options. I asked recommendations and my friends advised me to go and see what J.B.Rainsberger and M. Feathers would tell in their sessions. Here you have my summary of the first session, I hope you enjoy it as much as I enjoyed Rainsberger’s session!
A Simple Approach to Modular Desing by J. B. Rainsberger
What makes us good professionals, excellent programmers or designers? Being able to create and grow modular designs. What J. B. Rainsberger defines as a modular design is just four elements now minimized to two:
Passes it’s test- Minimizes duplication
- Maximizes clarity
Has fewer elements
Your career as a software developer is measured by how good your naming and duplication detection is. There is a whole spectrum in your own journey of improving names. You should be aware where you’re at and try to move forward.
But what can *you* do to improve your naming and spotting duplication so that you become an accomplished software designer? Practice, practice and then some more practice. You should follow the rules – which he’s being following for 3 years before being more intuitive - till you feel confident and interiorize the rules in such a way you don’t need to think of them and gain knowledge about when you can not / should not follow them. Those rules are quite simple – but not easy:
- You should be aware of the two elements of simple design
- You should do TDD
- You should not do integration test for basic correctness
- You should check one thing at a time
- You should start with what you want to check
- You should inject through the constructor
After that he programmed a little bit to practice what he had just told us, spotting naming and duplication while he was growing the system and applying refactors to it. If you’re good at it, a good naming helps architecture emerge as a good naming tends to group similar concepts and make distance between different responsibilities.
But how to explain all this refactor and gardening to your product owners? It’s quite easy once you talk about money and costs
Features mean money, money that your company can earn but also it means costs. It is desirable that all features had a low marginal cost, so cost should not be an issue to decide if a feature should be done or not. In order to achieve this marginal cost, refactors and naming time investments have to be done so your codebase is clear, simple and everything in its place ready for organic grow!









