By Ali Yun-Qin Qi

This article is a series of articles, which mainly introduces many interesting tasks in the field of Code Intelligence. It will be introduced from the brief introduction, history and current status of these tasks, hoping to give you a deep understanding of Code Intelligence. This article starts with one of the most commonly used and favorite features of developers — code recommendations — in the hope of unraveling the mystery of code intelligence.

Completion Completion:

Let’s start with a GIF.


Photo from Tabnine

As you can see, with the blessing of intelligent code recommendations, our development efficiency and programming happiness have greatly improved.

So what are the code recommendations?

We have all used input methods. When typing Chinese, most of them will conjure up possible phrases or sentences based on the characters that have been typed, which can greatly improve our typing speed. On the left of the picture below is the effect of Sogou input method, which will recommend the most likely input for people to choose; The picture on the right is an illustration of the error correction function of Exfil input method, which is very common and useful nowadays.



The same goes for code recommendations. In order to get rid of the need to tap letter by letter, the “slackers” have developed a variety of useful hints, all of which help programmers to program better to some extent. After using an editor with code hints, it’s hard to go back to notepad-like text editors.

Code recommendations are also called code hints, and there are a lot of similar names, Examples are IntelliSense, IntelliCode, Autocomplete, Code Completion, Code Snippets, Code Suggestion, Code Prediction, Code Hinting. Whatever it’s called, it describes the ability to provide code hints while programming, so don’t get stuck here.

History of code recommendations

The first study of code recommendations was in 1957, when spell-check was first proposed. Then, in 1971, Ralph Gorin developed the first spell-checking app, SPELL, which not only prompted letters, but also corrected simple misspellings.

Another code recommendation implementation that I have to mention is Microsoft IntelliSense, which is used in Visual Studio and provides a wealth of code hints, including types, variables, functions, snippets, keywords, and so on. By 2017, IntelliCode, another Microsoft project that uses machine learning as the underlying support for code recommendations, was also integrated into the VsCode editor by default.

Another thing to mention is SQL Server Management Studio’s built-in intelligent hints for SQL syntax, which can indicate commonly used keywords and contained libraries, tables, fields, etc. SQL syntax as the next generation of high-level language, and the current popular object-oriented languages such as JAVA, there are some differences in the implementation of code hint ability.


Status of code recommendations

The current generation of code hints has come to be regarded as the core competency of an editor or IDE, and the quality of code hints directly determines whether it is a good editor or not.

At present, there are many related researches, including models and algorithms that use various algorithms for training. The common ones are statistical algorithms and some natural language models. The current hot model is the GPT model provided by OpenAI, which has generated heated discussions with each release, from the first release to the current GPT-3. Tabnine, a popular code suggestion tool, is based on the GPT-2 model and provides intelligent and personalized code recommendation capabilities. It can recommend very personalized code according to the individual programming habits, which can be said to be very useful.


Another is the current controversial GitHub Copilot, which uses the GPT-3 model and trains with over a billion lines of open source code, and provides good recommendations. However, because sometimes the code prompted is directly open source code, it has been criticized for copying. There have been a number of developer campaigns against Copilot, but it’s unclear what will happen.


The future of code recommendations

Some say that with smart code recommendations, future programmers will be laid off.

Just take it as a joke, don’t say it now. While current code recommendation capabilities do save developers a lot of time, they are far from replacing programmers entirely.

Analogous to the autonomous driving classification, I think the code recommendation is up to L1, which is “sometimes able to assist the driver with certain driving tasks.” In the future, however, just as image-to-code already generates most static code from design sketches, I believe that code recommendations will become more intelligent, allowing programmers to simply mechanically repeat themselves and spend time writing “art.”



Tao department front end – F-X-Team opened micro blog! (Visible after Posting on Weibo)
More team content awaits you in addition to articles at 🔓