Why learning to code still matters in the age of AI
AI is transforming the way many build software. The tools available to us today enable us to generate functions and even entire applications within seconds. What once felt like science fiction is fast becoming our lived reality. So why bother learning to code today?
I appreciate there are many ethical and environmental concerns around using AI. However, many organisations are expecting their dev teams to utilise these tools. If we’re going to use AI to generate code, we need to recognise its limitations and why our own ability to write and understand code is still as important as it was in the past.
AI makes mistakes, we need to catch them
When we write code, it can contain bugs, security vulnerabilities, performance issues, or just simply miss project requirements. When we prompt AI to generate code, it’s not infallible, it regularly makes the same mistakes we make (and worse).
It’s important that we verify AI generated code meets our requirements, is issue free, and is understandable. We have an existing process for this in software development: the code review.
Code reviews have been a cornerstone of software development for many years. If we’re using AI to generate code, then reviews become even more critical. In order for us to effectively review code, we need to understand it.
Fixing AI’s mistakes ourselves is often best
We’ve established AI makes mistakes. We’re hopefully catching these when we review the code, but how do we go about fixing these?
If we’re already using AI to generate the code, it can be tempting to get these tools to fix the errors for us. However, each time we prompt AI we introduce new variability. This can create new problems as the AI tools we use today are probabilistic. AI will return the most probable answer from the prompt provided, not necessarily the correct answer. Engaging in a back-and-forth with AI can become unproductive, resulting in new issues arising with each prompt.
Often, it is going to be better and more productive for us to treat AI's response as an early draft and modify the code ourselves. To do this, we need at least some basic understanding of how to write code.
If you're not convinced by the productivity argument, research by METR has found experienced developers take longer to fix issues when using AI:
When developers are allowed to use AI tools, they take 19% longer to complete issues—a significant slowdown that goes against developer beliefs and expert forecasts.
Code needs the human touch
AI has never ‘lived’ the human experience. It doesn’t know what it’s like to struggle with accessibility issues or navigate cultural nuances. AI doesn’t understand our frustrations of a poorly created app, or the joys a creatively built website can bring us.
Most of the time, we’re building software for people. That’s why our human insight remains essential.
I advocate for diversity in the workplace. It brings different perspectives to a project and helps us build more inclusive solutions that have the widest reach in terms of users. This is something AI will never be able to truly deliver. It lacks the empathy needed to convert code from pure logic to thoughtful functionality.
Practice makes perfect
It’s perhaps important to note that learning code is not enough to be an effective developer, even in an AI powered world.
Watching Youtube clips, reading books and articles, and studying codebases will not fully equip you to understand code. You need to actually write it.
Programming is a creative process, and like other art forms we can only maintain our existing abilities and expand on them by practicing. We need to be careful that we don't become too dependent on AI to generate code; we need to still be able write it independently.
Writing code is fun!
Finally, beyond all practical reasons why you should still learn to code, there’s still a joy to be found in writing it yourself.
Like many others, I started writing code as a hobby. There's something incredibly satisfying about writing some code and then seeing it in action. Like many crafts, it's that sense of achievement knowing that you've built something yourself. Yes, you can use AI to generate some code for you, but there's a soullessness about the end result. Much of the fun of code comes from the process of figuring out how to achieve something, and writing it in a beautiful way.
Final words
AI might be becoming part of our working process. However, real people are still at the heart of coding. We remain the problem solvers, the creatives, the code reviewers and maintainers. When things fail, it is us that needs to engage with the code.
Learning to code today is as important as it has always been.