Don’t write the code until you have to write the code

Kevin McCarthy
2 min readMar 24, 2021

--

TL:DR make sure you’re going to need the code you write before you write it.

While learning to code I learned about doing the AFM (Absolute flipping minimum) in order to get tests passing. Its a cornerstone of how I learned to do TDD (Test Driven Development).

This also applies to doing pretty much any feature. I learned this the hard way recently.

Update by text

In a recent all hands one of our seller focused teams talked about how it was hard to get sellers to update their items of furniture as sold on the website if they had sold them in their shop or on some other platform. They gave the example of them selling something at a market and then needing to remember to mark it as sold.

Eureka!

Immediately I thought how handy it would be if they could do it quickly from their phone. I’d done a small project using Twillio before and so immediately thought about how to make it so they could text a number and it would update the status immediately.

Personal hackathon

I spent a couple hours over the weekend (what an eager beaver), putting together a prototype and had loads of fun with Twillio’s remarkably easy API. I showed some people at work on Monday and everyone was very impressed.

The big launch

We got it prioritised and so I spent a few days re-implementing it, added tests did some refactoring and was real pleased with myself.

And we launched! Sent emails to all our sellers, created a dashboard to track all the listings updated via text…

NO-ONE TEXTED!

AT ALL.

I thought our reporting was broken so did a test run. It showed up immediately.

No-one wanted it! No-one used it!

What I do now

I wait as long as I can to write the code. For this one I may have just given out a number to text and then manually updated listings if anyone texted. We would have learned pretty quickly if anyone cared. Which of course they didn’t.

--

--

No responses yet