Can AI-Assisted Coding Replace Developers For Good?
Artificial Intelligence (AI) is quickly becoming a popular tool for people in many professions, and software developers are no exception. But how good is AI-assisted coding? And can it replace developers completely?
In this article, an innovation analyst at Exadel and leader in AI and data management will elaborate on what AI is good and bad at, and how it will change the way software engineers write code.
What AI-Assisted Coding Is Capable Of
You may be asking yourself, ‘What is AI-assisted coding?’ AI assistants include various tools to help developers write code faster and more accurately. Plus, AI in coding can alleviate a few templated, robotic tasks.
Imagine a director who would like to get many things done in a day, but is unable to do so due to some mundane yet important routine tasks.
A director hires an executive assistant so as not to compromise the quality of those mundane tasks. This new employee becomes the right hand for this director, working on those tasks that don’t require conscious creativity, critical thinking, and profound decision-making.
As a result, more work gets done and the director feels more productive and satisfied. Now they are freed up to take care of tasks requiring more critical and creative thinking, thus boosting the company’s bottom line.
Think how silly it would look if this director wasted time doing repetitive work instead of taking care of the growth and development of the business.
Moving away from the above metaphor and back to AI-assisted coding, some AI tools are general-purpose models that can be used for all kinds of tasks, including code generation. You have certainly heard of ChatGPT, arguably the best-known example, or any of the other GPT models.
Also, developer-specific tools can do auto-completion tasks and are well integrated into modern development environments. The most famous of these is Github Copilot. You might also have heard of such tools as Tabnine or Amazon CodeWhisperer.
Consequently, the challenge of how to code with AI is no longer an issue because you can simply delegate repetitive and templated tasks to a specific AI tool.
-
92% of the US developers
already use AI in their work according to a recent GitHub survey
How AI Is Used in Coding
There are many tasks generative AI coding can help with. The typical ones include:
-
Natural Language to Code Translation
Some AI models allow developers to describe functionality in natural language, and the model generates the corresponding code. This can be especially useful both for those who are learning to code, and for professionals who want to quickly prototype an idea.
-
Code Suggestions and Autocompletion
AI in coding can suggest entire lines or blocks of code as developers type, predicting the most likely next methods or functions based on the current context. This can significantly speed up coding and reduce syntax errors.
-
Documentation, Comments, or Unit Tests Generation
AI in coding can help generate documentation and comments for a codebase, summarizing what a function or module does. Also, AI models can analyze both the code and its documentation to generate unit tests.
-
Smart Searches and Codebase Inquiries
AI-powered tools can swiftly retrieve relevant code snippets, functions, or classes from your entire codebase. These tools answer questions about your codebase, saving you the effort of manual searching.
Key Benefits of Using AI in Coding
There are some areas of development where AI Assistants can really save you some time. For example:
-
Repetitive Code
Generative AI coding is good at predicting what’s expected from the surrounding context, so if you need code similar to the existing lines the AI will easily predict it.
-
Comments and Documentation
AI-assisted coding is good at understanding what’s going on in your method or a class, so it can write accurate comments and documentation.
But there is one important caveat. Even if the comment looks accurate and grammatically correct, it may not be comprehensive. A wise person once said that good comments should not explain what is happening in the code, but why it is happening this way. In other words, it should add more context: system limitations or business requirements that explain the choice of a certain solution. AI is usually unaware of such things, so the generated comments may be unhelpful. But they can be used as a good starting point for adding details.
-
Unit Tests
AI-assisted coding can also write unit tests or at least provide a skeleton that can be altered to your needs.
-
Code Refactoring and Renaming
As we all know, naming variables is one of the hardest things in software engineering. AI in coding can provide refactoring capabilities and suggest better names for variables and methods.
-
Learning New Technologies
Chat-based AIs can really speed up your learning process. When you are learning a new language or tool, there is always a learning barrier when at first you don’t know anything and have to sit through lots of tutorials with abstract and irrelevant examples. With AI-assisted coding, you can ask it to solve your specific problem using your desired tool and get a relevant example which will be much easier to understand.
Main Roadblocks to Using AI to Write Code
Although there are great advantages to using AI in coding, several serious limitations remain.
Edge Cases and Non-Standard Situations
AI-assisted coding usually suggests the most straightforward solution to your problem, it does not think about edge cases, unexpected inputs, or any kind of additional problems. It would be nice if chat-based assistants asked more clarifying questions, instead of just suggesting a solution.
Context-Agnostic AI in Coding
AI may know everything about your codebase, but it still lacks some of the context that you have. It knows nothing about Jira tickets and Confluence pages, about email threads and Slack chats. Also, AI-assisted coding knows nothing about your previous experience which influences your decisions. Usually, there are many ways to solve the same task with code, and you choose the optimal solution based on your experience and available information. Until AI has the same access to this data, it cannot choose solutions as optimally as you do.
High-Level Architecture or Application Structure
AI-assisted coding may be able to complete a line of code or a method, or sometimes even write a class. But organizing classes into modules, splitting the responsibility, and thinking about high-level interactions is still mostly a human job.
Difficult Third-Party APIs Integrations
We often have to use third-party libraries when working on projects. If a library is not well-known, not open-source or just relatively fresh, AI knows little to nothing about it. And if AI lacks knowledge and starts to hallucinate, it will suggest nonsense. Such cases are very frustrating and can render assistants almost useless.
Must-Have Troubleshooting and Team Communication
Finally, and perhaps most importantly, coding is not the main part of the job for middle, senior and lead specialists. We spend a lot of time communicating with customers and teammates, troubleshooting, debugging, reading documentation, etc. Many developers wish they spent less time doing this and more time coding!
Will Coding Be Replaced by AI?
Short answer — no.
But AI-assisted coding, along with GenAI software development, will change how software engineers work with code, and we should be ready for it.
First of all, we need to understand that AI is only a tool, and as with any tool, it still needs a person to use it wisely and validate its results. Also, it takes some time to get used to working with AI and find the ways it is helpful to you in particular.
Developers must shift their mindset from writing code to reviewing the outputs from AI-assisted coding. We will need to start formulating tasks more precisely, review code carefully, and think about edge cases and tricky scenarios.
In many ways, generative AI coding is similar to mentoring a junior developer, which requires the same amount of attention and sometimes even patience. In a couple of years, it will be as common to work with а coding assistant as using an IDE or Google daily. So, it’s better to get acquainted with this technology — the sooner, the better.
What’s Next In Our Reading Digest for AI in Coding?
Our next article will touch on the most popular and effective AI coding assistants, and will also offer an in-depth analysis of their pros and cons.
Author: Liubou Masiuk, Senior Developer at Exadel
Was this article useful for you?
Get in the know with our publications, including the latest expert blogs
End-to-End Digital Transformation
Reach out to our experts to discuss how we can elevate your business