Cranking Design to 11: Corey Haines on the Global Day of Code Retreat and the Art of Practice

Cranking Design to 11: Corey Haines on the Global Day of Code Retreat and the Art of Practice

UGtastic Archive
Transcript Verified
The Interviewer

Mike Hall

Interviewer, community organizer at UGtastic

The Guest

Corey Haines

Software Craftsman, Founder of Global Day of Code Retreat

The Conversation


Mike Hall Interviewer, community organizer at UGtastic
Hi, I'm Mike with UGtastic. I'm sitting here with Corey Haines. Corey does the Global Day of Code Retreats and he's also very active in just speaking and being involved in user groups and technical education. So, Corey, can you tell us a little bit about what is Global Day of Code Retreat and what's a code retreat?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Okay, so Code Retreat's an event. It's a community-focused, directed practice event that has been going on for almost four years now. It's all over the world and it's a day focused on practice rather than learning a new technology.
Mike Hall Interviewer, community organizer at UGtastic
So, you just write code? How do you practice?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
There's a set format for it. We work on Conway's Game of Life in 45-minute sessions. At the end of each session, we delete all of the code we did, swap pairs, and start again. We do it about five or six times throughout the day.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
In each session, we introduce different constraints and ideas around object-oriented design, test-driven development, and pairing. It's a day of pushing yourself past where you normally code. We take normal clean code constraints and design ideas and crank them up to 11.
Mike Hall Interviewer, community organizer at UGtastic
I've been to one or two of your events—things like 'no return values' or 'don't use conditional statements' is always interesting. But for the audience, what languages are you using? Is this a Ruby-specific thing?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
It's language agnostic. We ask people to come with their 'language of convenience' set up. If you've never done Clojure and somebody there has an environment ready, you can pair with them for 45 minutes to get a feel for it. We see a lot of Java, C#, and Ruby, but it's intended to be language agnostic.
Mike Hall Interviewer, community organizer at UGtastic
So, what do people do when they can't finish the problem in 45 minutes?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Very few people can; it's intentionally chosen so that you can't finish. The goal is to retreat from the normal pressures of finishing. We all know we write our worst code when rushing under time pressure. The day is built to allow freedom to experiment and try new things. By the end of the day, people are laughing at not finishing, and the pressure to finish is replaced by a focus on investigating design ideas.
Mike Hall Interviewer, community organizer at UGtastic
Have you ever had anybody just bring out a pre-written solution?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
In the first session, people sometimes hack out a solution because they're still in that mindset of wanting to get it done. But as we say, it's easy to get something working when you write crap. The idea of the day is to write the best code you've ever written. We encourage people to shoot for 'gold plating' and take refactoring to the extreme.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
By going too far, you get a better sense for when you are building a production system of how far you actually *can* go. If you over-engineer or extract too many methods in a code retreat, it doesn't matter because you throw it away. That experience gives you perspective for your day job.
Mike Hall Interviewer, community organizer at UGtastic
What's the most unique solution you've seen? Has anybody implemented it in VimScript or Bash?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
We've had people use Bash script and I think one team tried VimScript. At a code retreat in Colorado, some people wrote a reasonable solution in about six lines of Ruby. I usually encourage people to over-engineer—make a ton of classes, keep very small methods—to really understand what the term over-engineering actually means.
Mike Hall Interviewer, community organizer at UGtastic
Now, about the global aspect. You started these as one-off things, but now you do one that spans the entire globe in a single day.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
In August 2011, I blogged asking if it would be cool to have 20 cities doing this on the same day. By December 5th, we had 94 cities across 14 time zones. I did Sydney first, then caught a 6 PM flight that landed in Honolulu at 6:45 AM the same day. This year we're aiming for 200 cities; we already have 60 registered.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Global Day is about bringing the community together and training new facilitators. The format is so well-defined that even a 'horrible' facilitator can have a great day if they stick to the script. I've coached many active community members through their first facilitation via Skype.
Mike Hall Interviewer, community organizer at UGtastic
Has it reached the point where code retreats are happening that you don't even know about?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
I'm very strict about the format. If you want to call it a Code Retreat, you must follow the format. It's intended to be decentralized now. It's a wonderful feeling to know it's grown beyond me and isn't centered around me anymore. I'm just an instigator or curator now.
Mike Hall Interviewer, community organizer at UGtastic
Could someone do a Functional Code Retreat?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Absolutely. The format is the 45 minutes, the throwing code away, and Conway's Game of Life. I'm an OO guy, but J.B. Reinsberger started 'Legacy Code Retreat' using a horrible code base that Chet Hendrickson and Patrick Welsh put together. There's also a test automation Code Retreat. I love seeing the family of Code Retreats expand as long as the specific type is clear to attendees.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
I want people to experiment with different exercises around specific techniques—like a functional Code Retreat. In OO, the 'no return values' exercise is fantastic for design style, but in Clojure, which is built on data transforms, it might not be as valuable. But it still makes you think: if data always goes one way, what if it goes another?
Mike Hall Interviewer, community organizer at UGtastic
It's a way to break out of the 'wagon trail' where you code the same way for so long you end up in ruts.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Exactly. Or what happens when the wagon wheel falls off, or you get dysentery, or Bobby dies? Global Day is about increasing the number of people comfortable facilitating and expanding those boundaries.
Mike Hall Interviewer, community organizer at UGtastic
For people interested in participating or running one, where should they go?
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Coderetreat.org is our social network. All the info for Global Day and upcoming weekend events is there.
Mike Hall Interviewer, community organizer at UGtastic
Great. Well, thank you very much, Corey.
Corey Haines Software Craftsman, Founder of Global Day of Code Retreat
Thanks so much. These are great interviews.

Critical Insights


durable
"Code Retreat's 'throwaway' constraint (deleting code every 45 minutes) is a powerful pedagogical tool that removes the pressure to finish and allows for deep investigation into design patterns and 'extreme' refactoring."
durable
"The use of Conway's Game of Life as a constant problem space allows developers to ignore domain complexity and focus entirely on the subtleties of design and practice."
durable
"Language-agnostic pair programming facilitates cross-pollination of ideas, allowing developers to experience new paradigms (like functional programming) through the lens of a familiar problem."
durable
"Decentralization is the ultimate sign of success for a community movement; when the 'Code Retreat' format became self-sustaining without Corey Haines' direct involvement, it reached its full potential."
durable
"The 'Code Retreat Family' (Legacy, Test Automation, Functional) demonstrates how a rigid structural format can be successfully adapted to diverse technical disciplines by maintaining core principles of practice."
durable
"Deliberate over-engineering in a safe, throwaway environment helps developers recognize and internalize the boundaries of pragmatism in their production code."