Last week, I committed a code change that pretty much looked like this:
if (expr1) {
if (expr2) {
// logic here
}
}
My code reviewer pointed out that this could be changed to –
if (expr1 && expr2) {
// logic here
}
I read their comment and stared at my PR in disbelief for the next 17 mins.
The original code isn’t incorrect. It’s just a poor style of coding, a style that I would never prefer and yet, I committed it. I started thinking about why I committed such low quality code into a PR and then remembered that it was generated by GitHub Copilot.
However, that didn’t make me feel better ’cause I knew I dropped the ball on reviewing the code quality of the Copilot generated code. I was so busy checking for the correctness and making the code work, that I forgot to check for quality. Sure, I had a deadline, but that’s no excuse to check-in poor quality code. This is just one example. There were a few other similar trivial issues in my PR.
I’ve been using these AI assistants for programming help since a while now and using them productively is not as straightforward as it seems. It is very easy to get carried away by their help.

Most times, the code generation by these copilots is counterproductive. I know I can write better code than the copilot suggestions.
This is the major downside of using copilot too much; it puts you on an autopilot and that’s not good at all.
Something similar happened a couple of weeks ago. I was trying to build a component using React Spectrum and was using GitHub Copilot to help me through the building process. After 2 days, I made very little progress and that too with low quality code. I got frustrated by the development pace, dropped using Copilot and switched to checking the documentation. It took me less than 20 mins to implement what I was trying to.
Before these copilots, I would typically refer to the official documentation as the first approach. Not StackOverflow, but the official documentation. Thanks to these copilots, I’ve stopped doing that and instead started over-relying on them.
After using these copilots for a considerable amount of time, I can say with certainty that my cognitive thinking ability has taken a hit. I’ve also become mentally lazy. I’m a very enthusiastic learner and enjoy exploring new avenues in my fields of interest. For the first time, I’ve noticed that I’ve been offloading a lot of the creative work to these copilots and this to me, is very bad.
I’m grateful to the fact that I realized this relatively sooner. I love being creative and the reason why I love coding is because it’s one of those areas where I get to be creative and create something.
Moving forward, I will drastically minimize the usage of the inline-code-suggestions and just use these copilots as a substitute to looking up approaches or even doing the mundane stuff like filling out patters and such. I think that’s good for improving my coding and thinking ability. I strongly urge my blog readers to review their reliance on these tools.
Over-reliance on copilots will put you on autopilot and that is very bad. It creates mental laziness and that is something to avoid.

Comments