What is Code Retreat ?
45 Minutes is quite a short period of time to work on a project let alone complete it, but that is what we attempted to do at code-retreat on April 14 2012. But the goal was never to complete it. Confused ? Read on →
Code retreat is a unique exercise invented by Corey Haines to hone the art an skill of software development.
Coderetreat is a day-long, intensive practice event, focusing on the fundamentals of software development and design.
The day consists of about 4-6 iterations of 45 minutes each and the code written is deleted after each session. The participants try to solve a problem which is un-solvable in 45 minutes by paring up as teams of two. The teams are changed after each iteration. So no participant works with another participant more than once.
JUG Chennai Code Retreat
The Venue
Collabnet chennai was gracious enough to put us up with a venue at the 11th hour. We had Mr.I Jeyanthan to thank for that .
The facilitator
The facilitator is the person who guides all the participants on the methodologies and the techniques of Test Driven Development. We were honored to welcome Dr.Venkat Subramaniam as our facilitator. He introduced us to a new way of thinking about the art programming.
The Problem
The problem that we attempted to solve was Conway’s Game of Life. The rules of the game are simple to understand but are as complex to code as you think it is .
* Any live cell with fewer than two live neighbors dies, as if caused by under-population.
* Any live cell with two or three live neighbors lives on to the next generation.
* Any live cell with more than three live neighbors dies, as if by overcrowding.
* Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
The Iterations
During the first Iterations many of the participants had no clue as to what TDD was, and we just cranked out code and hoped it would work. At the end of the iteration we were asked to talk about what we did and the experience of it. This made us understand the importance of Testing Code.
In the second Iteration people who did not know about TDD paired up with people who did, This resulted in almost everyone understanding at least one testing framework and what Unit tests were, by the time the second iteration was finished.
The Tokyo Connection
JUG-Chennai lead Rajmahendra had heard about some Code Retreat happening simultaneously at Tokyo and we decided to call them and say Hello. There was a discussion about the languages used and the Tokyo Guys were using Small Talk to solve Game of life. Since they were about 3 hours ahead of us, by the time we called they were already into the last iteration.
During the third iteration we had come up with ideas on how to store the Grid. Most people went with a 2D array but other approaches like using a Hash-Map and using a Position Object were also tried.
In the final discussion before lunch we talked about why Testing was even necessary and whether it slowed the rate of development. We were given some interesting analogies to think about by Dr.Subramaniam like how doctors in the 19th and early 20 Century rejected Lister’s germ theory and finally everyone realised the importance of Hygiene.
Writing code without Tests is like performing surgery without washing hands .
Post lunch iteration had a big slump in productivity as nothing really intriguing came of it. Someone had pointed out in the retrospection on why writing Hash Maps after lunch was a big mistake .
In the next session since we had all recovered, we tried doing some useful code and many came close to the solution and still managed to write some tests to back it up.
The final Iteration was a General discussion on many topics like productivity, The power of functional languages etc.
Finally As a note of appreciation to collabnet, Dr.Venkat Subramaniam enlightened us ways to improve the way we communicate by using Version Control Systems, especially Subversion.
He showed us why using email for conversations/ sharing files was evil and how using VCS made things more intuitive.
By the end of the day everyone was infected with the TDD bug and how the shift in paradigm to writing tests before writing code made a huge difference in the quality of the software .






Hi Raj, Gautam & JUG
It was a exiting day for me. Never thought it’s going to be so interesting. Everyone who participated had a good attitude, I think thats one of the reason for the success.
I want to thank Dr.Venkat Subramaniam for guiding us and patiently answering our questions. Thank you Raj for making coderetreat possible in Chennai. Thanks to Jeyanthan for organising the venue.
Some more points,
1. By the end of every iteration, we were able to come closer(mirage) to the solution.
2. The number of methods/functions we had in mind got lesser and lesser during every iteration.
3. Its not just about understanding(overview) the problem(Game of Life), but also our level of understanding it. The more deeper we go, we get more clarity on what we should program/design/logics. So the number of methods,variables,lines of code reduced. Initailly this flow of idea happens slowly, the day when all of these happen fast then we are good developers. Coderetreat helps us to reach that level.
4. Coderetreat is nice exercise to our mind, which helps to understand any problem, go deeper, & solve it that too QUICKLY.
5. During a retrospection, someone mentioned that when he wrote the Test cases first, he learnt “What NOT to do” while coding. TDD really helps to AVOID mistakes while programming. Reduces the number of bugs in the code.
6. People who participated in coderetreat can feel the difference from the next time they do programming. I could feel that.
7. Among the four 4 rules of design, TDD was the problamatic one for most of us. We were not able to apply the idea of writing test even before coding was started. Venkatji gave us nice examples and the importance of TDD. Except the 1st rule, I was able to improve myself on the rest of the three(variables, no duplication, smaller code). Think it will take me some more time (weeks… even months) to get to the habit of TDD.
8. I was surprised at the end, when Venkatji explained how the infinite boundary can be acheived with the idea of a globe. Even its a short-cut, I enjoyed it.
9. The fun starts, when we pair with someone who uses a different programming language,that we don’t know. That’s one of the place where we can know how good is our programming lanuguage is & whats new in other languages, the logics, number of lines,style of programming, how a small function/API in another language can solve the problem easily. Ex. Loops, UI, testing tools,etc,..
10. In between the coding, there were some philosophical discussions too happening.
11. The Tokyo connection was nice interaction. Remember like they used Java, Ruby, python & small talk. Raj, think next time should try for a online coderetreat, connecting with people across the globe. You made CR possible in Chennai, so I think you can do a global CodeRetreat. Possibly with using Skype, G+, may be something new tomorrow.
Thank you Gautam for such a nice summary of the day, I believe you have lot of observation skill and memory to write about all that happen. Memorable post. Even after few months when we read the posting, will feel like going back to that day. Thanks to every participant without you it wont be this much fun, 25+ is a good number. Since more people, more languages, more talks, more idea, more noise, more fun.
Finally, for any event we need to come prepared, but for coderetreat DONT EVER COME PREPARED. If you do it then you miss the fun !!!!
S Dhinesh Karthick