Full Disclosure: This is a post from Jibran Khan, founder of Studio Saffron, a small studio in Karachi, Pakistan. Saffron Library is our own project, and we plan to sell courses, packs, and support around it. Nothing in this post is for sale here.
So I run an indie studio based in Karachi, Pakistan. We spent about a year building a game which we published. The game was a bunch of god classes, public statics, singletons, DRY violations, YAGNI violations, SRP violations, not an interface in sight etc etc
Rather than making another game on that ball of elastic bands, I thought let’s refactor so we can take the next swing cheaper. Turns out I have a habit of making tough refactoring calls, following a belief in a better tomorrow, and almost 1.5 years later Saffron Library slowly emerged. First as a separate repo that lived within the repo of another project. Now slowly a collection of DLLs with an accompanying documentation website.
We’ve learned many lessons along the way across art, design, engineering, and marketing, and I think we’ve built something pretty decent. For this topic I’d like to stick to engineering.
Once upon a time I found myself knee deep in reviews, with code coming at me left and right. I spent time reviewing it and found it missed some basic idea, structure, or technique, and a rewrite was in order. So I thought to myself, why not slow down the process and examine the thinking first.
Therefore in my studio an engineer will first write out one or multiple documents before writing code. These documents get reviewed by a senior before anything is worked on:
- A set of bullet points
- A template of an outline
- A template of a proposal
This is a set of increasingly more detailed documents, and the senior engineer can ask the junior to write what’s appropriate based on their understanding. Why did we have less detailed docs? It was done to be more in line with agile. Give the team the option to need less documentation, but still have a method to require more if needed.
The big lesson we learned along the way: it pays to formally examine thinking before writing a single line of code.
How about you folks? Do you have any lessons like ours that help lower code churn?