Slow coding

I often think of myself as a slow reader. I don't know how quickly most people read an averaged-sized book but I feel like I probably am a lot slower than the norm. When I'm reading I don't feel like I'm reading slow but when I hear people say they read a few books a week, the record usually screeches for me — because my pace is more like one book a month.

The other day I spent what I felt was way too long to write some fairly simple code. I'd start writing it, then scratch it, start over, scratch it, bite my nails and think about it for a while, start again, scratch it. You get the point.

I was pretty happy with the end result. Looking over the final code I thought, WTF took me so long to write this? Well, coding, like most arts (and yes I consider coding an art form of sorts), takes a lot of forethought. Oftentimes simple problems are slower to write solutions for — Mainly because of the many ways to get the job done.

Then comes the premature optimization thoughts. What if, in the future, this little helper function that does some data transformation (or whatever) becomes the bottleneck in a huge critical application. I better think about that scenario now to avoid a painful re-write later. Yeah. Yeah. I better think this through really carefully.

an hour goes by

Nah, this is dumb. Just write the damn thing.

As a joke I explained the context and requirements to ChatGPT and asked the AI overlord to write the function I needed. It was shit. So I asked for a few retries — still shit. Sure I guess maybe it would have worked, but I didn't like the solution they wrote. It felt crammed together, like forcing the square peg into the round hole. Sure, it got in there, but it wasn't pretty.

In the end I think my way of coding actually saves time. I tend to really try and think about the problem, the solution, the outcomes of the solution, and potential pitfalls of what I would write before I truly commit to something.

Sure, sometimes I write code for an hour only to have to scrap it all in the end because I misjudged a situation or a requirement that made all the work I did useless.

I asked a few friends about their coding habits and it seems I'm not alone. Some of the best developers I know are slow coders too. Of course, there are also some developers I admire that seem to pump out software non-stop. Much like the speed readers, I don't get how they do it.

Still, I'm glad to see I'm in good company over here in the slow car.