Search

Lessons Learned at Global Day of Coderetreat

Jonathan Wallace

3 min read

Dec 12, 2011

Lessons Learned at Global Day of Coderetreat

In case you missed it, the awesome Globay Day of Coderetreat occurred on December 3rd. The amount of fun I experienced was unexpected and impressive! I learned some things too. Read on to find out what.

(Also, don’t worry if you missed the code retreat, sad kitten has some good news for you at the end of this post.)

I managed to make it out to Knoxville where they held the most awesome code retreat. Congrats to Brian Friesen for putting together such an excellent event.

For those not familiar with code retreats, you pair program with six different people under different constraints during each session. You delete all code between sessions. And you only work on one problem, Conway’s Game of Life.

Lessons learned:

  1. You can’t code Game of Life in forty-five minutes. Or you can, if you’re really really good. Or if you’ve done it five times before in the same day and you skimp on tests and still probably not even then.

  2. Sometimes you’re the teacher, sometimes you’re the student. Enjoy both!

  3. C# is looking cooler and cooler. But not cool enough to pull me away from Ruby. (Sorry .NET recruiters. You can stop emailing me now. Seriously. Stop.)

  4. How to make proper use of equality in ruby to generate a unique collection of items.

Let’s talk about number four!

Most of the attendees were C# developers. I was the lone ruby hold out and convinced a couple of my fellow attendees to give ruby a try. They were enjoying the ruby exploration and implementation until we hit a little snag.

I wanted to get a Set of a Point class instances. Given an array of Points, I wanted ruby to spit back out only the unique items. Overriding == didn’t work. Overriding .eql? didn’t work either. Neither did any combination thereof. Gah, this was extremely frustrating.

After a precious wasted 10-15 minutes I, mildly embarassed, threw in the towel. We moved on.. and of course, did not finish implementing GoL in ruby.

The C# devs were still impressed with ruby but I couldn’t let it go. During the lunch break, I spent some time (another 10-15 minutes) googling and came up with:

See it in action here. I based the code on a nice module implementation of equality and further discussion of equality in ruby.

The key is to override both #hash and #eql?.

Upon further reflection, my chagrin at ignorance of implementing equality in arbitrary Ruby classes was misplaced. The point of a code retreat is to practice, to get better. To learn from one another. Sometimes, even when you’re the teacher, you’re still the student. That’s one of the reasons we love code reviews so much at Highgroove).

Have you gone to a code retreat? If so, what did you learn?

p.s. Oh, I almost forgot. The great news for those of you who missed it, or want to again, is that I’m hosting a code retreat in Athens in 2012. Come check it out!

Steve Sparks

Reviewer Big Nerd Ranch

Steve Sparks has been a Nerd since 2011 and an electronics geek since age five. His primary focus is on iOS, watchOS, and tvOS development. He plays guitar and makes strange and terrifying contraptions. He lives in Atlanta with his family.

Speak with a Nerd

Schedule a call today! Our team of Nerds are ready to help

Let's Talk

Related Posts

We are ready to discuss your needs.

Not applicable? Click here to schedule a call.

Stay in Touch WITH Big Nerd Ranch News