DEV Community

frontpills
frontpills

Posted on • Updated on

You shouldn't use AI for programming

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:

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.


Originally published at frontpills.com

Top comments (8)

Collapse
 
dror_wayne_fine profile image
Dror Wayne

You're absolutely right - AI has a crucial part to play in software development but it's important to check these things off of your list first too.

That said, remember AI can do a lot more than just write code. Using knowledge of your code, ai.fine.dev can give YOU guidance on how to approach a problem, for example.

Collapse
 
caitlinconsults profile image
Caitlin Davies

You raise some great points, particularly about understanding the problem and the importance of context. genAI is like a newly hired junior developer -- we should always check its work!

Collapse
 
albertmorrishow profile image
Albert Marcus Morrishow

Would that be, ‘responses much accurate’, or ‘responses more accurate’?

Collapse
 
frontpills profile image
frontpills
Collapse
 
pywasi profile image
Wasi Kahn

I agree! However just curious what you think about stuff like cursos or copilot where it is isn't "AI code" but "AI assisted code"?

Collapse
 
frontpills profile image
frontpills

These are essential tools you can't ignore while programming. However, you should use them within a very specific context (as mentioned in my post, "understand the problem"). The more specific, the better. Once you receive an answer or suggestion, it's crucial to evaluate it carefully (as discussed in the post, "understand the solution"). If you don't fully understand both the problem and the solution, you're acting unprofessionally and potentially introducing bugs into the code.

Collapse
 
pywasi profile image
Wasi Kahn • Edited

ye but i find that it's more informative to write your own solution first and then use AI generated to find weaknesess in your own code etc...if I go for AI assisted code first I wouldn't understand the problem deep enough to even evaluate the AI's code properly...know what I mean? So, I guess, what I'm trying to say is that I prefer using LLMs as an evaluation engine rather than a generation engine? As in, go for it last to find missed areas or other assumption errors in your own solution..thereby not only improving the code but also yourself :)

Wondering what you think of the above? Also wondering how your experience has been with Supermave? I haven't really used any assistants - only tried using chatgpt for some code but felt that it would be easier to just write the code rather than give it the loooong granular prompt it required to produce the correct code..

Thread Thread
 
frontpills profile image
frontpills • Edited

Yes, agree, use it like an assistant. That's my point with the post, it's a extra tool you can use to improve your code, but it shouldn’t be at the center of the development process.

However, most of the time, I’d leave that to automatic analysis tools that check your code when opening a PR.

About Supermaven, it's a fantastic tool, and I believe it’s the best in its category.