Learn a Language and EAT!
Here at Detroit Labs, we get together for an hour and a half weekly to play with a language that is new to all of us (except Nathan Dotz who has toyed with all programming languages ever). We pick a chef for the week, that person brings us in a crock pot of deliciousities, and we all gather round for the first half an hour and go through environment setup together. We try to look at the basic structure of one unit test and maybe how to make a function in said language, and when the clock hits twelve, we are done no matter how far we got. Then we go over the very quick rules and exercise. Our rules:
- Write the simplest test you can to make progress
- Write only enough code to make your test pass
- Only refactor on green!
- Pair!!! Ping Pong Style.
- You write a very simple failing test (non-compiling counts as failing)
- You pass the keyboard to your pair to make it pass writing only enough code as is necessary
- Your pair writes another simple failing test and passes the keyboard back
- You’re not supposed to finish the exercise.
- Don’t be a wang.
That last one is in there just to have the team and individuals hold themselves accountable for not being negative. This is a safe, supportive place where almost none of us have any idea what we’re doing and are there to stumble through the often uncomfortable steps of learning as a team. As for the exercise, we always do the Prime Factors kata. That seems like it might get boring, but think of it like this: you use different katas in your everyday programming language to help you get better at that language. What you know is the language, what you don’t know is the new kata. In our case, we know the kata very well (we spent the first two weeks doing it in two languages we’re familiar with, just to make sure), but it’s the language we don’t know. We have the same balance (using something we know to learn something we don’t), we just flipped the script on what goes where in that equation. For those unfamiliar, the prime factors kata is:
Given an integer, return a list of factors for that integer that are prime numbers. For example:
and so on.
So far, we’ve done java and objective-c (our first two), rust, elm, and go. Oh, in case I didn’t mention, we don’t pick the language ahead of time, we just choose from the pool of languages that we have put on a big list to try out. Soon, we’ll have a big wheel to spin and everything, but for now, we just choose at random. Guests are welcome to join, so long as they follow the above rules and RSVP in enough time to warn the week’s chef, so feel free to twitter at us at @DetroitLabs, or even just @crebma!