a practical guide to creating a space where good programmers can become great programmers
2012 - 2013 Emily Bache. Cover picture copyright Topaz/F1online.
Foreword
Do you remember this old joke? A young man is on the subway, carrying a guitar case. Hes a member of a band that is performing a concert at Carnegie Hall; and hes running late. He dashes off the train and up the stairs, and realizes hes lost. He knows that the performance hall is close, but he doesnt know the direction. So he stops an old man on the street and asks: Excuse me sir, but how do I get to Carnegie Hall? The old man looks at the lad with his guitar case and says: Practice son, Practice.
It is a fundamental truth that all professionals practice. Of course professional musicians practice; and so do professional athletes. Lawyers practice they rehearse testimony and closing statements. Doctors practice, on cadavers, dummies, and even suturing oranges. All professionals practice.
What do we, programmers, do to practice? We write code of course. Lots of code. We write code at work, and then many of us go home and write more code. We do this because we love writing code; it is a passion for us.
But not all forms of practice are equal. Some ways to practice are better than others. Professional athletes practice games, but they also practice drills. Musicians practice their performances, but they also practice scales and etudes. These other forms of practice are designed to emphasize, and therefore improve, certain skills especially those skills that are hard to acquire and easy to lose.
Thats what this book is all about a special way to practice that emphasizes certain skills that are hard for programmers to acquire and easy for them to lose. Those skills include working together as a team, the disciplines of Test Driven Development and Refactoring, good design skills, and many others.
In this book Emily Bache describes one of the most popular activities to come out of the Software Craftsmanship movement; an activity that is sweeping across our industry: The Coding Dojo. Based on a martial arts theme, the Coding Dojo is a meeting in which enthusiastic software developers, intent on self improvement, engage in purposeful practice for the purpose of refining their skills.
The Dojo gives a formal structure to such practice. That structure is complete with rituals, disciplines, rules, and procedures that promote effective learning and minimize distraction. The Dojo is a safe place to practice with, and learn from, others. Best of all, the Dojo is fun!
In this book youll get a feel for just how much fun this can be; because Emily avidly describes the fun she has had in setting up, running, and participating in Dojos. Her enthusiasm is contagious. Youll read about her adventures, successes, failures, and just the overall great time shes had while learning, and helping others to learn, in the Dojo setting.
With her lively and readable style, Emily teaches us how to set up a Dojo, and what the principles, rules, and procedures are. She tell us how to deal with what she calls: Dojo Disasters; and she describes the various forms of practice such as Kata and Randori. And, perhaps most importantly, she provides a catalog of the exercises that she has found most beneficial in a Dojo.
But theres more to this book than a description of Dojos. While describing the disciplines and principles of Dojos, Emily also engages us with a very cogent and enlightening description of some of the most important software disciplines of the last decade. These include Test Driven Development, Refactoring, Continuous Integration, Test Automation, and many, many others.
In short, while this book is a wonderful workbook for practice; it is also a tutorial in what to practice. The subtitle says it all: This book is about making good programmers great.
Is that your goal? Do you want to be a great programmer? Then you dont want to miss this book. Because to become great, theres only one absolute rule: Practice child practice.
Robert C. Martin
17th November 2012
Introduction
As a professional programmer, how do you learn new skills like Test Driven Development? Pair Programming? Design principles? Do you work on a team where not everyone is enthusiastic about good design and writing automated tests? How can you promote good practices amongst your colleagues?
Ive worked as a programmer for many years, and these kinds of questions have come up again and again. This handbook is a collection of concrete ideas for how you can get started with a coding dojo where you (and your team) can focus on improving your practical coding skills. In my experience, its a fun and rewarding activity for any bunch of coders.
Learning new skills inevitably takes time and involves making mistakes. In your daily work environment where the focus is on delivering working production code, it can be hard to justify experimenting with new techniques or to persuade others to try them. When I attended my first Coding Dojo with Laurent Bossavit and Emmanuel Gaillot in 2005, I could see these kinds of meetings could be a fun way to effect change.
When you step into the coding dojo, you leave your daily coding environment, with all the associated complexities and problems, and enter a safe environment where you can try stuff out, make mistakes and learn with others. Its a breathing space where the focus is not on delivering solutions, but rather on being aware of what you actually do when you produce code, and how to improve that process. The benefits multiply if you can arrange to bring your whole team with you into the dojo. Through discussion and practicing on exercises, you can make a lasting impact on the way you work together.
Following the dojo I attended in 2005, I brought Laurent to my (then) workplace to show us all how it was done, and from there I began to facilitate coding dojos in various other settings. Ive done them with my immediate colleagues, user groups, at conferences, and more recently as a paid consultant brought in to do training with teams. Inspired by Corey Haines, Ive also led Code Retreat days, which is a kind of scaled up coding dojo. All these events have been good fun - coders enjoy coding! Weve had excellent discussions, learnt from each other, and written a significant amount of clean code and tests. It seems to me that acquiring skills like TDD, Refactoring and pair programming is a long process - it takes years - and it is a lot more fun and rewarding if you can get a like minded group of people to join you on that journey.
This handbook is a collection of practical advice drawn from my experience, with concrete ideas for how you can get started with your own coding dojo. There is a catalogue of Kata coding exercises that you can try, and advice about how to choose one for your particular situation. There are many useful resources on the internet which you can use to augment your dojo, and some are reviewed here.
Kent Beck once said Im not a great programmer, Im just a good programmer with great habits. What are you doing to improve your coding habits? This is the book with the advice and encouragement you need: get together with some like-minded people and hold a coding dojo! Its fun!
Acknowledgments
This book has its origins in the work of Dave Thomas, who introduced the idea of the Code Kata, and Laurent Bossavit who came up with the idea of the Coding Dojo, and co-founded the first one in Paris. Over the years many others have also contributed to develop the idea and the practice. Im especially grateful to Laurent Bossavit, Emmanuel Gaillot and Fredrik Wendt, pioneers who I have collaborated with and learnt from in the dojo.