You shouldn’t use AI for programming.
Well, not exactly. You shouldn’t use AI for programming in certain situations:
- Not as a fundamental step in your coding process.
- Not if you don’t understand the problem.
- Not if you don’t understand the solution.
- Not while you’re still learning.
- Not right now.
This week, I read this tweet by @housecor:
In the age of AI, code reviews are more important than ever.
— Cory House (@housecor) October 8, 2024
The developer may not have read the code.
The main idea really resonated with me. I write and review hundreds of lines of code every week, and I believe I can sense when a piece of code is written with AI. Right now, it’s often easy to detect. Most of the time, the generated code feels a bit “off”, to put it simply. However, it won’t be long before the generated code becomes more natural and is no longer easy to spot.
That said, I don’t think using AI is inherently negative—no more than using Photoshop to edit a photo or generating an Excel formula. It’s just a tool, and the tool itself isn’t the problem. It’s the lack of training and wrong expectations.
You shouldn’t use AI as a fundamental step in your coding process. Coding is not a mechanical task. It’s a creative process that involves thought and experience. It’s not just about being effective but about being efficient. You don’t just need any solution, you need the best solution. Typically, a developer can consider several solutions for the same problem and decide which one is the most appropriate in the current context. When using AI to model or solve a problem, the solution it provides will likely influence our decision on which path to take.
You shouldn’t use AI if you don’t understand the problem. The most critical part of AI assistance is context. For instance, in the race to increase context in coding assistants, Supermaven is probably the most powerful tool, with a context of 1 million tokens, that makes Supermaven responses more accurate. The quality of the response will depend on the information and detail provided to the assistant. It’s essential to fully understand the problem in order to describe it in the best possible detail to the AI.
You shouldn’t use AI if you don’t understand the solution. This is perhaps the most common cause of buggy code when using AI. It’s necessary to understand the solution that the AI generates, analyze it, comprehend it, and subject it to thorough review and testing. There is no guarantee that the AI will provide a correct solution, so review is a must. Since it’s quite difficult to provide the full context to the AI, the solution requirements may differ from the original requirements.
You shouldn’t use AI while you’re still learning. This specifically applies when you’re learning to code. AI should only be used when focusing your learning on specific questions. For example: What is a React hook? What is the observer pattern? How can I animate a button?. Other types of more general questions or complex problems require deeper knowledge and experience. In the context of building applications, as I mentioned in my previous two points, it’s necessary to understand both the problem and the solution. A student doesn’t have enough technical expertise to evaluate the quality and effectiveness of a proposed code solution. It’s much more challenging to progress in learning when answers are given without proper guidance.
You shouldn’t use AI for programming right now. We haven’t yet reached the point where AIs can take full responsibility for the entire development process, at least in terms of code writing. Although recent years have shown remarkable progress in this field, perfecting current models and outputs will require exponentially more effort.
AI is here to stay. I’m not completely dismissing this tool, not even at such an early stage like the one we’re experiencing now. However, if we truly want to get value from it, we need to acknowledge its current limitations. It’s a fantastic aid, and the best way I can describe its role is that of an assistant. It’s an assistant for programming, reviewing, or learning. But it’s not a programmer, lead, or teacher. Not yet.
Use your own brain. Use your judgment, and use AI responsibly and professionally.
P.S.: This post was made possible thanks to the assistance and review of an AI, demonstrating that, when used properly, it can be a valuable ally.