I asked each candidate to do the exercise in the programming language of their choice, with pen and paper rather than on a computer. By requiring them to use pen and paper rather than letting them use a computer, I prevented them from simply Googling a solution. It would also force them to actually think about the solution rather than simply go through the “type in some code / run it and see what happens / type in some more code” cycle.
Commenters are expressing violent disagreement, violent agreement, and violent alternative implementations in everything from Perl to Racket.
One thing missing from the discussion was a worked example. To fill the gap, here’s a video of me driving FizzBuzz with tests:
Tests “force you to think about the solution”, without googling, and without pen & paper.
You see the algorithm built in small steps. When you take big steps, it’s easy to get lost. When you take small steps, errors are small and easy to find. Being able to take small steps is a useful skill. Demonstrating that skill with pen & paper in about 3 minutes seems… tricky.
These are my tools at work. This is much closer to how I solve other problems. A formal, repeatable feedback loop helps thinking through the problem.
December 3rd was the first Global Day of Coderetreat. Over 2200 developers in 90 cities participated. Back in November, while planning a trip to Chicago for SCNA, Corey confirmed that nobody was facilitating in Toronto. This city has a really active software scene, so I figured I’d give it a shot. Here’s the result:
It couldn’t have happened without help:
Thanks to my fellow Coderetreaters. Practicing your craft at 8:30am? On a Saturday? Many commuting over an hour? That’s just baller.
Thanks to my employer, Learnhub, for the office and license to cause mayhem with furniture.
Our sessions looked like this:
Intro to the Game of Life. For some, this Coderetreat was a first. Plus it’s good to warm-up before the coffee kicks in.
Kent Beck’s Four Rules of Simple Design. There are various formulations, but I prefer the minimal:
Choose Your Own Adventure. Pairs picked one or more constraints from a list. Popular choices included no conditionals, no iteration, methods under 2/5 lines, “Tell, Don’t Ask”, and no objects.
Evil Mute Ping Pong. “Mute” because talking is prohibited. “Evil” because Implementors can use whatever loopholes they find to make the tests pass.
Make It Work. Write the worst code you can. Give it your best shot. A good way to wind down.
The final retrospective offered a variety of thoughts, with a couple common themes: [re]discovering TDD, getting to know both new and familiar languages, and thinking about the social aspects of our craft.
Srdjan and Martin plotting. Loaned my ARxTA/Github-stickered laptop. Pretty sure they tried breaking Ruby. Gonna have to check on that.
Damon and Marcus in Deep Pairing Mode.
Dan tells me he had a great time retreating into deliberate practice. Owen was happy to spend some time with Ruby sans Rails.
Tim laughs at the code while Taz… gestures at the code. That’ll teach it.
Mark and Roxanne also in Deep Pairing Mode.
Anna and Austin did unspeakable things with nested hashes. But hey, there’s a Clean Code guarantee.
Kyle firing eye lazors at the code while Chris drives.
Yehoram concentrates despite James utterly smashing the fourth wall!