AI Code Assistants Are Your Friend, Not Your Replacement — App Development
AI has the potential to make developers more efficient at nearly every task, from code generation, review, optimization, debugging, and even documentation writing. Studios can start using AI to review and manage code immediately, reducing tedious work and identifying issues developers may miss.
However, AI can generate vulnerable or unworkable code, and copyright rules around AI-generated code are still unclear. Due to these concerns, AI-generated code should always be reviewed by a human developer, and studios may want to proceed with caution when using AI-generated code in their final products.
AI code generators can help developers come up with solutions when they are stuck or quickly create foundational code. These tools are controlled with natural language prompts, like ChatGPT, so they are especially useful for developers working in unfamiliar languages. Most AI tools can translate code from one programming language to another, which greatly speeds up reusing code across projects on different platforms. And many AI tools can write effective test cases to validate existing code, freeing up developers to spend more time on productive code.
However, AI will often produce code that contains bugs, doesn’t function as intended, or won’t run at all. A recent study found that three of the top AI tools only generated correct code a fraction of the time: ChatGPT (65.2%), GitHub Copilot (46.3%), and Amazon CodeWhisperer (31.1%). Other studies have warned that AI-generated code can have security vulnerabilities. Due to these issues, AI-generated code should be viewed as an assistant for developers rather than a replacement.
One of the best ways AI can increase productivity is through code prediction and completion. With these tools, AI suggests code that can complete tasks based on developers’ current actions and documentation (image, image). Developers can cycle through multiple suggestions and accept part or all of the suggested code.
According to GitHub, the amount of developers’ code being generated by the GitHub Copilot tool has increased from 27% in June 2022 to 46% in February 2023, which suggests developers are pleased with the results. In one study, Copilot was able to increase developers’ coding speed by 55%.
In gaming, Roblox has its own code completion AI for UGC creators called Code Assist. The beta feature has seen strong adoption within the Roblox ecosystem. Since Code Assist’s beta release in March 2023, Code Assist has been used by 41% of beta users. The amount of inserted code has increased by 35%, and deleted code suggestions have decreased by 14%. Roblox also launched a Material Generation AI tool in March. It has been used by 36% of beta users and corresponded with a 50% daily increase in users creating material variations. You can read more about AI-generated art in our report.
Review, Optimization, & Debugging
AI can help developers review and manage existing code, allowing developers to focus more on creating new code. Specialized AI tools expedite code reviews by scanning repositories for potential issues and then suggesting code solutions and actionable feedback. These tools not only detect bugs and security vulnerabilities but also look for deeper issues that could affect the code’s reliability. Developers can use AI to identify performance bottlenecks, remove redundant code, improve maintainability and readability, and suggest other optimizations.
AI can also help teams of developers stay on the same page. Many AI tools can generate natural language documentation for code, reducing the time developers spend summarizing their code’s functionality. AI can even suggest ways to keep code style consistent across teams to improve collaboration. And some AI tools, such as ChatGPT and GitHub Copilot’s “Explain” feature, allow users to get straightforward explanations of code they don’t understand, which is particularly useful for developers trying to understand code written by other teammates (image).
ChatGPT is a natural language chatbot from OpenAI that can be used to generate, explain, and review code. Version 3.5 is available for free for all users. A $20 monthly subscription to ChatGPT Plus gives users faster response time, availability even when demand is high, and priority access to new features. The latest GPT model, GPT-4, is in beta and is only available for ChatGPT Plus members (image). A waitlist for the GPT-4 API is available on the developer’s site.
Note: OpenAI Codex was discontinued by OpenAI on March 23 due to newer, more powerful GPT models. However, GitHub announced GitHub Copilot X the day before. Copilot X is a new version that will incorporate GPT-4 as well as a chat terminal, pull request support, and other improvements. A waitlist is available on their site. In the meantime, the prior version of Copilot remains operational.
AlphaCode is a coding assistant tool developed by Google DeepMind (image). The model made waves in 2022 for beating human programmers in multiple coding competitions. AlphaCode is part of Google’s Research team and hasn’t been officially launched, but they’ve posted some of their research on their blog.
IBM Watson Code Assistant is part of IBM’s suite of AI products (image). The tool is scheduled to be released later in 2023, with the first use case focused on AI-generated code suggestions for Ansible Playbooks. More information and a waitlist are available on IBM’s site.
Although no legal precedent has been established regarding AI-generated code, the most cautious studios should consider training their own AI models or restricting AI to non-generative uses for the time being. There are new licenses that aim to clarify how code can be used by AI, but it’ll likely take time for developers to update their code with these licenses and for models to be retrained.
On March 16th, 2023, the US Copyright Office released guidance stating that AI-generated works cannot be copyrighted because they are not human-authored works. To qualify for copyright, AI code must be materially modified by human developers.
There are also several lawsuits against generative AI companies claiming that AI models were unlawfully trained on copyrighted works. While many AI models were trained on open-source code, some open-source licenses have limitations on use or require attribution. And since GitHub and Amazon even admit that their models may suggest code that’s identical to snippets from their training set, developers using AI-generated code could taint their own code with license violations. Copilot and CodeWhisperer offer flagging tools that can identify identical code, but it’s unclear if these tools are thorough enough to catch every instance.