About a week ago we hosted the first ever Code Retreat at the office! We were about 15 happy devs who sat for an entire day contemplating over good code and good practices. To help us out we had Adrian Bolboaca who flew in to facilitate the sessions for the day and guide us.
We had before hand decided to split the day in two; the first part being deliberate practice for clean code, and the other part on refactoring legacy code fast and safe.
In the coding dojo before lunch we sat down with the very basics of coding. Doing things from scratch, thinking deliberately about why we do something, how we do it and how to name it. The purpose was not to finish, but to come up with something really good and try to work in a way that might not be what everyone is used to doing daily. Think. Deliberate. Leave nothing for coincidence.
One of the things that I think most of us took away from this part was “The Boyscout Rule”. It states that whereever you go, leave the place in a better state than when you got there. It applies to code as well. “It works, so don’t touch it” is not a good solution, that does not evolve and improve the code meaning it will go stale and fragile in time. Constant change improves and hardenes it along with the change of time.
In the second part we got to work with an existing piece of code where the objective to be able to change it without some of the risks involved when there are no unit tests and the code might be fragile. So we focused on end-to-end testing, and getting a feel for how to write these tests without impacting the code first. Then, when some basics are in place, refactor the code to be able to write more and better tests, always improving in small steps and see how it all evolves from a pile of crap into something not that bad.
So why did we do this again? Sit down for an entire day and not getting anything *real* done? Well, in order to constantly improve you must practice, like any other professional athlete. For us this was a test shot to see whether we liked the form as a group and see how we can go further with it, making sure that we all get better at what we do and strive for a better place for ourselves.
“Really felt like a retreat due to the use of external conference room, reinvigorated the feeling of being an actual coder” -Participant