Sessions‎ > ‎2011 Sessions‎ > ‎

Facilitating Code Retreat

What is Code Retreat?

·         A repeatable event designed to help developers to:

o   Write better code.

o   Learn to take risks and experiment.

o   Learn to practice writing code

·         See Code Retreat introduction video:


How does Code Retreat Work?

·         Participants work on implementing Conway’s Game of Life.

·         Participants work in pairs the entire day.

·         The day is organized in a series of 45 minute iterations.

·         After each iteration:

o   Each pair deletes their code.

o   A short retrospective is held

o   Pairs switch partners. If possible, everyone should pair with someone different each iteration.

·         Early code retreats were restricted to a single language. Today, most code retreats are open to any language.

o   Multi-language code retreats give developers the opportunity to see how a different language can influence how they think and approach a problem.

Why it works

·         Deleting the code removes the pressure to “get something done.” It frees developers to explore and experiment without the pressure to complete the task.

·         Pairing with many different people allows developers to learn from each other.

o   Each developer has a slightly different perspective, and a slightly different approach to a problem.

o   Exposing developers to different perspectives gives them the opportunity to strengthen and improve their own style.

What Code Retreat is Good For

·         It is good for the things it was originally designed for.

·         It can be used as a team building exercise.

o   Can be used internally within a company.

o   Can increase cross-functional awareness.

·         Great event for helping to enrich the local developer community.

What Code Retreat is NOT Good For

·         Learning or teaching a new language.

o   The structure of Code Retreat is designed to help developers improve their skills in what they already know. It is NOT a good place to try to teach a new language.

o   A coding dojo or a less structured hackathon is better suited to exploring a new language.

Tips for Facilitating a Code Retreat

·         Strong suggestion: Attend two or three code retreats before attempting to facilitate one on your own.

·         Find a company to host the event.

·         Find a separate company to sponsor lunch.

o   It is important to provide a nice lunch (not Pizza!)

o   Remember that many developers are Vegetarians.

o   Try to support the local economy – get food from a local restaurant.

·         For the first iteration, don’t add any challenges. Participants spend the first iteration setting up and engaging Conway’s Game of Life for the first time.

o   Deleting the code is usually a significant enough challenge for most people on the first iteration.

·         For subsequent iterations, add a new “challenge” to keep participants learning.

o   Ensure that participants are challenged just enough for learning to happen.

§  Presenting too hard of a challenge will only frustrate participants.

o   Talk about and emphasize the Four Rules of Simple Design.

o   Remove a tool which developers are used to using:

§  Example: Not allowed to write code using conditional statements (no if statements, no while loops, etc).

o   Introduce “TDD as if you meant it”



·         During the iterations…

o   Wonder around the room and observe how and what each pair is writing.

o   Feel free to ask questions about what each pair is doing.

o   When appropriate, ask questions which provoke the pair to question their approach (might not want to do this on the first iteration). Examples:

§  “Why did you name the method getLiveCells?”

§  “Why didn’t you write any tests?”

§  “Why are you refactoring code while you have a failing test?”

·         Keep an eye out for someone who didn’t have a good pairing experience. Make sure that person gets a chance to pair with someone else who you think will provide a better experience.


·         Corey Haines’ Code Retreat Tour website (great information about code retreat in general)


·         The Code Retreat Ning Site (place to organize and register for code retreats)


·         Code Retreat introduction video:


·         Conway’s Game of Life on Wikipedia


·         The Four Rules of Simple Design


·         TDD as if you Meant It