I’m not afraid to change my own code. And it’s all my own
Collective Ownership Abstract
Collective code ownership means that everyone on the team is responsible for all the code in the code base. It encourages every team member to contribute new ideas and quickly understand the ideas of other developers behind different segments of the code. Everybody on the team can add necessary functionality anywhere in the code, improve interfaces between the entities or refactor any piece. Real collaboration in agile team starts with collective ownership.
Pair Programming / Peer Review
Paired Programming is one of the definitive practices of XP. We highly recommend paired-programming, although it isn’t absolutely essential. When pairing takes place developers tend to discuss their methods more. Perhaps more important, they learn from each other – not just about how they are solving the problem, but how they solve problems. Conversations between people is the best form of knowledge transfer. This is one of the reasons ATDD is so useful. In the case of pairing it improves the understanding and disciplined following of how to design, write and test code.
One of the recent trends in Agile methods is the realization that explicit policies/workflow improves a team’s abilities tremendously. This is one of the core practices of Kanban.
Design Patterns are not always thought about as a way of collaboration. However, patterns represent a way of thinking – a way that should be shared by the team. Teams that understand design patterns will solve problems together in a more cohesive manner and be better able to implement the practices described throughout this document.
Shared Code & Coding Standards
Shared code in XP meant anyone could update it. Of course, XP’s core practices of paired-programming, TDD with automated testing, and continuous integration, makes this a pretty safe practice. We consider shared code to be a goal – one that is not always achieved. To actually implement it, the development team must have a shared understanding of what quality code and practices are.
Coding standards are more than merely how you name your variables and where you put your curly brackets. Rather, it includes the approach you take for programming. XP’s main approach here includes a few key practices:
- Programming by Intention is a simple method
- The once and only once rule is another way for saying “no redundancy.” Unfortunately, it’s not really possible to avoid redundancy completely. However, one can manage redundancy by attending to Shalloway’s Law.
- Encapsulate by policy, reveal by need. Encapsulation is a low-cost method of putting design layers in.
- Attending to the quality of the code. The quality of code can be measured by how well it manifests several characteristics of code. These are encapsulation, strong cohesion, proper coupling, no redundancy, readability and testability.
Jeffries, Ron. Extreme Programming Installed. Chapter 11 (Programming). Addison-Wesley, 2000.
Last update 15 January, 2013
© 2010-2013 Leffingwell, LLC.