Teaching and Learning Through Code Katas
Teaching and Learning Through Code Katas
About the Bundle
These two books complement each other, and can help you become a better programmer. "The Coding Dojo Handbook" is a practical guide to setting up a space where programmers can meet, discuss, and practice on Code Kata exercises. "Mocks, Fakes and Stubs" illustrates a number of modern programming techniques with Code Kata exercises. Both books are by the same author, and share the same lively, practical tone.
About the Books
The Coding Dojo Handbook
a practical guide to creating a space where good programmers can become great programmers
Please note that there is also a print version of this book available for purchase, for example on lulu.
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?
I've 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, it’s 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. It's 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. I've done them with my immediate colleagues, user groups, at conferences, and and more recently as a paid consultant brought in to do training with teams. Inspired by Corey Haines, I've also led "Code Retreat" days, which is a kind of scaled up coding dojo. All these events have been good fun - coders enjoy coding! We've 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 "I'm not a great programmer, I'm 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! It's fun!
 page 97 of "Refactoring" by Martin Fowler
Mocks, Fakes and Stubs
and other techniques in Test Driven Development, illustrated with Code Katas
If you're interested in improving your practice at programming in general, and Test Driven Development in particular, I'd suggest doing code katas is a good way to learn. There's a host of programmers around the world using code katas to hone their skills and learn from one another, in a coding dojo, at a code retreat, in a pair on a lunchbreak, or just by themselves. This book uses Code Katas to illustrate some modern coding techniques, so you can learn about, and practice them.
A code kata is a simple coding problem that may take a little effort to solve the first time, but the point is you don't only do it once. Start over from scratch and try it again, but think more carefully about how you're solving it. Can you work in small steps, refactoring often, and keep your design simple and clean? Can you write a good suite of automated tests that support your development and provide good regression protection for future maintenance work? The challenge in a Code Kata is to solve the problem well, and to demonstrate good practices in how you reach your solution. If you're using Code Katas like this, you'll find you build up a repertoire of katas that you know well, and can use to polish your coding technique.
Code Katas are also useful when you're trying out something new - a tool, technique or coding environment. Keep one variable the same - the problem to solve - and see how your coding experience, design, and tests are affected by the new element. It's this way of using Code Katas that is the focus of this book. I'm assuming you are familiar with each code kata, and can use it to show you a new technique.
In this book I'll show you examples including, but not limited to, Mocks Fakes and Stubs. I'll also discuss techniques like London School TDD, Outside-In development, and Approval testing. I'll begin each topic with a discussion of the theory, and follow it up with some code listings and sample tests. My aim is that it'll be a little like pair programming with someone experienced in the technique, who can explain what they mean both in theory and example, and give you some commentary about when you might choose to use it. You'll definitely be expected to put in some work yourself, learning the Code Katas, and trying the techniques out for yourself. It'll certainly be more fun if you can get a group together and start a Coding Dojo.
My first book, "The Coding Dojo Handbook", is full of practical advice about how to set up this kind of a space for learning. While I was working on that book, I found myself writing long passages about particular techniques, and how you could learn about them using some of the code katas listed in the catalogue in that book. In the end, I decided that material didn't belong in "The Coding Dojo Handbook", and that it would be better to start a new book.
The techniques in "Mocks, Fakes and Stubs" are all useful to practice in a Coding Dojo environment, but not exclusively. I've included examples taken from a range of programming languages, including Java, Python, C++ and C#. You can do a Code Kata in pretty much any language you feel like, and you'll find and starting code is available in many popular languages on my Github page. All the code katas used in this book are listed in the Kata Catalogue from "The Coding Dojo Handbook".
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them