How I use AI to boost my Software Engineering productivity
AI still hallucinates, generates slop, and can't reason about the big picture. But it's still an incredible productivity tool for software engineers. This post is about how I use it.
Fever dreams of having AI write all our complex software for us are still largely that, fever dreams.
But used correctly, it’s still a powerful tool to get more done, with fewer defects. My use has evolved with time, and my first steps were much the same as everyone else:
First steps: Copilot completion & “fix this!”
Like most others, my first steps were paying for Github Copilot, and asking ChatGPT, and later Claude general questions about code sticking points and algorithms.
The first gains were, for a former RSI sufferer, welcome: it simply made me type less. Github Copilots early in-editor support is autocompletion on steroids, nothing more, nothing less.
Also, having an interactive search like ChatGPT to quickly get personalised responses to what in the past would have been a Google search for a StackOverflow result, is great. We have StackOverflow on steroids!
The big win with the first iteration of tools was less typing, less spending time completely stuck on things of trivia.
Second steps: Contextual help
The next generation has been tools like Cursor, Avante, Cody, and further iterations of Github Copilot - these live in your IDE or editor of choice, and can take a snippet of code, whole file, set of files or whole project as context, and give you help in writing code, writing tests or solving issues like finding the unbalanced brace or other syntactical issues.
I too went through this phase. It’s like having an over-eager junior developer you’re pairing with, who knows algorithms and API’s better than you, but couldn’t see the forest for the trees, if their virtual life depended on it.
At this point, we are writing even less code, but we need a firm hand to drive our virtual junior colleague. They easily miss context, get stuck in loops, or simply cannot solve problems that require more than a few pieces of context in your head at the same time.
We’re not getting replaced anytime soon, the only thing that is happening is that the nature of how we do our job is changing: we are becoming supervisors, while the minutae of typing is becoming less important.
Where I am today: my virtual pairing partner
I am still using AI in all of the aforementioned ways, but I’ve found a few additional use-cases, that really unlocked additional productivity..
I provide the AI assistant with context (usually a few files at a time), constraints, and requirements, and ask it to:
Find issues with my code: ask if it achieves the given aim, and if there are any issues, smells or edge-cases I can’t see.
Suggest improvements: Are there ways in which the code can be improved? If there are, I will usually provide additional context, and ask for specific improvement suggestions in the areas highlighted.
Explain to me what this code does: In the case of code, I am not familiar with, but can explain what it is part of.
Explain third-party API behaviors: especially useful with systems that are stateful. Most APIs are pretty sucky. But widely used APIs are at least well enough documented and discussed for AI to have been trained on its foibles.
Ask outright whether specific edge-cases I can envision are covered by a piece of code.
Look at my tests and my code, analyze whether the tests are comprehensive, or if there are further edge-cases I have missed.
Verify my SQL is syntactically correct for the dialect I am using, and ensure it is efficient.
..and yes, for relatively trivial, but typing intensive tasks, I frequently let the AI generate the code for me. But beware, it’s fraught with issues for anything that goes beyond trivial, which barely makes it worthwhile.
Basically, I have started using AI (I use Cody with Claude as my primary assistant these days) like a pair programming partner, whom I ask the questions I would ask a human pair. With the exception that Claude/Cody never gets tired, never switches off, has amazing recall of API specifics, but can’t see the big picture very well.
The main takeaway for me is, Pair Programming has always been an effective way to review and improve code. While AI assistants are not yet anywhere near human level, they nonetheless provide a valuable second pair of “eyes” to review ongoing work, if prompted correctly.
Conclusions
Software engineering as a profession isn’t going away anytime soon. But it is evolving at a rapid pace, and we need to keep adapting. Adopt, adapt, or become irrelevant.
So far, I wouldn’t say AI is making me hyper-productive compared to my 2022 self, but it is certainly adding 10-20% at least. At the same time, used correctly, I think, rather than generating “AI slop”, we can leverage AI to make our co-created software more reliable, by asking the right questions, and critically taking in the input.
And I’m sure if you ask me again in 18 months, my use will have further evolved.