Insights | Digital Enablement

4 Ways AI Coding Assistants Can Help Developers

AI Coding Assistants promise to increase the productivity of development teams. So, how well do they work in the real world?

Young Asian programmer coding in his home office

 

Artificial Intelligence continues to evolve faster and faster – we see articles in our newsfeeds every day about how AI can write poems and proposals, summarize academic papers and medical diagnoses, drive cars, and detect credit card fraud and “unusual” network activity. At RevGen, we’ve been exploring AI Coding Assistants and how they can help our developers and our clients.

 

What Are AI Coding Assistants?

 

AI Coding Assistants use a generative AI engine like ChatGPT to offer suggestions, make recommendations, and propose code snippets. They can suggest code for whole functions and procedures, or simply point out where a variable needs to be reset.

The best assistants do this based on an analysis of vast amounts of code, learning coding patterns, best practices, and common errors. Combined with an understanding of the codebase the developer is working in, these tools can really live up to the moniker of “artificial intelligence.” One tool, GitHub CoPilot, claims that developers accept 35% of suggestions made by the tool.

 

How Do AI Coding Assistants Help Developers?

 

Productivity – AI Coding Assistants help developers be more productive by offering autocompletion, writing simple or repetitive code, pointing out common mistakes, and suggesting libraries or functions that can eliminate the need to write some code at all. They can even help write comments and documentation: what developer doesn’t want that? All of this leads to less time spent on development and increased productivity.

 

A sample of code that reads: // set date ranges for my team and other teams
Adding a comment above a function to describe what the function does.

 

Learning – By providing well-written code snippets and suggesting optimizations, these tools can help developers improve their skills. What used to take hours of weeding through StackOverflow to find the best solution is now suggested right there in the integrated development environment (IDE).

 

A sample of code that reads: # set the start date to 1 year ago from todaystart_date = dt.datetime.now() - dt.timedelta(days=365)
Working in an unfamiliar language (Python) to do some date math.

 

Quality & Consistency – AI Coding Assistants improve the overall quality of the codebase. By suggesting consistent code and enforcing coding standards, these tools improve the readability of code while minimizing bugs and increasing maintainability.

So, What Can’t AI Coding Assistants Do?

 

Understand Complex Logic – AI Coding Assistants readily suggest syntax and code snippets, but they cannot understand complex requirements and build the code to suit.

 

A sample of code that reads: // take an array of ranges and return an array of ranges that are not in the array of ranges passed inwith an example from AI Coding Assistant that does not fit the prompt
Assumptions are being made about inclusivity in the ranges and the bot suggests multiple inputs even when the comment says “an array”.

 

Solve Problems – AI Coding Assistants struggle with complex or unique coding challenges that require deep problem-solving abilities.

Be Creative – These tools can suggest solutions based on the codebases they have learned from but cannot come up with creative or innovative solutions on their own.

 

What AI Coding Assistant Tools Are Out There?

 

The two most popular tools are currently GitHub CoPilot and Amazon CodeWhisperer. Other tools such as tabnine and CodeSquire bring AI Code Assistant functionality to a wider variety of environments while others have a specific focus (CodeWP works exclusively with WordPress) or use case (What The Diff is focused on code review and documentation). Furthermore, traditional generative AI tools such as ChatGPT can write code that developers can copy and paste into their IDE since the current version of CoPilot is built on an older version of GPT.

 

How Well Do They Work in the Real World?

 

Since it’s been years since I wrote any code, I spoke to an architect at RevGen with significant experience using these tools to get a first-hand understanding of how they work in the real world. They estimate that the use of GitHub CoPilot might save them as much as 25-30% of their time.

They find that the tool works especially well for repetitive code (i.e., setting up loops, writing click-handlers, etc.) and helping with code comments. They have also had it identify extraneous code when reading over the generated comments. By creating a comment such as “//loop over the list of date ranges and return a merged list” they can prompt CoPilot to suggest useful code that requires minimal effort to incorporate. Finally, they said that CoPilot is great at finding bugs related to resetting state, such as suggesting other variables to be reset to their default value.

However, our architect warned me that developers need to be diligent when using these tools. They can often misunderstand context and introduce errors if the developer is not paying attention or is inexperienced; they caught one coding assistant inventing variable and function names instead of using what already existed in the file.

 

Conclusion

 

AI Coding Assistants are changing the landscape of software development. Their ability to enhance productivity, improve code quality, and help developers learn their craft is revolutionizing the way developers work. As they continue to evolve, these assistants will become more sophisticated, freeing developers from menial tasks and allowing them to focus on what they do best: creating software that drives enterprises forward.

At RevGen, we’re always evaluating the latest in technology – across Digital Solutions, Data and Analytics, and Customer Experience – to help bring value to our customers. Artificial Intelligence is rapidly changing the landscape of what is possible and we are happy to help you navigate how these new tools can help you write amazing software to transform your organization.

 

Noah Benedict of RevGen Partners

Noah Benedict leads RevGen’s Digital Enablement practice.  He is passionate about using technology to advance business and empower his clients to embrace new opportunities.

Subscribe to our Newsletter

Get the latest updates and Insights from RevGen delivered straight to your inbox.