Community Blog Learning about Intelligent Code Completion

Learning about Intelligent Code Completion

This article explains the history and current situation of code completion.

By Qinqi

This article is Part 1 of a series that discusses many interesting tasks involved in the field of code intelligence. Each entry in the series includes several key aspects, such as a brief introduction, history, and current situation, in the hope of giving everyone a deep understanding of code intelligence. This article starts with code completion, one of the most commonly used and most favored developer functions. We hope this will help uncover the mystery of code intelligence.

1. Code Completion

Let's start with a gif from the Tabnine official website:


As you can see, our development efficiency and programming experience have improved substantially.

What is code completion?

Multilingual users need multiple input methods on their computers. When Chinese speakers input Chinese, most input methods will associate the possible phrases or sentences according to the entered characters like predictive text. This can improve typing speed. In the following picture, the left part shows the effect of SogouInput, which recommends the most likely results based on the input characters. The right part shows the effect of the intelligent error correction of the Xunfei input method. These functions are now very common and useful.


The idea of code completion is similar with Input Method. Lazy people have developed various useful tools to save developers from typing letter by letter. These tools help us program better to a certain extent. We found it hard to go back to text editors like NotePad after using an editor with code prompt.

Code completion is also called code prompt and has many other names, such as IntelliSense, IntelliCode, Autocomplete, Code Snippets, Code Suggestion, Code Prediction, and Code Hitting. No matter what it is called, it describes the capability to provide code prompt during programming.

2. History of Code Completion

The earliest study on code completion was in 1957 when spell-check was first proposed. Then, in 1971, Ralph Gorin developed the first spell-check application, SPELL, which could give hints according to letters and correct simple spelling errors from misplaced letters.

Another code completion implementation worth mentioning is Microsoft's IntelliSense. It is applied in Visual Studio and provides a wide range of code prompt capabilities, including prompt of types, variables, functions, snippets, and keywords. In 2017, another Microsoft project, IntelliCode, used machine learning as the underlying support for code completion. This capability was also integrated into the VsCode editor by default.

It is also worth mentioning that the intelligent code completion of SQL Server Management Studio's SQL syntax can prompt common keywords and libraries, tables, and fields included. As a next-generation high-level language, SQL syntax is somewhat different from the currently popular object-oriented languages, such as Java. Its code completion capability is also different.


3. The Status Quo of Code Completion

Currently, code completion has reached an era of fierce contention. It has been regarded as the necessary core capability of an editor or IDE, and its quality directly determines whether it is a good editor or not.

There are also many related studies, including training models and algorithms that use various algorithms. Common ones are statistical algorithms and some natural language models. One of today's popular models is the GPT model provided by OpenAI. Starting from the first version to the current GPT-3 version, each release has sparked heated discussions. Tabnine is a very popular code prompt tool based on the GPT-2 model that provides intelligent and personalized code completion. It can provide a very personalized code prompt according to users' programming habits, which is very user-friendly.


Another one is the controversial GitHub Copilot, which uses the GPT-3 model and more than one billion lines of open-source code for training and provides a good prompt capability. However, since the code prompted occasionally uses open-source code, it was accused of plagiarism. Many developers have launched a campaign to boycott Copilot, and the follow-up is still unknown.


4. The Future of Code Completion

Some people say programmers will lose their jobs because of intelligent code completion.

This is not true. Code completion saves developers a lot of time, but it is far from taking the place of programmers altogether.

Compared to the classification of autonomous driving, code completion can probably reach Level 1 at most. Level 1 means sometimes it can assist the driver to complete certain driving tasks. However, in the future, anything is possible. Currently, image to code has already been able to generate most static code according to the design draft. I believe code completion will become more intelligent, allowing programmers to spend time writing art instead of simple mechanical work.

0 0 0
Share on

Alibaba F(x) Team

66 posts | 3 followers

You may also like