- What are you? null, undefined – or just nullish? - 22. Oktober 2021
- AI-based Code Autocompletion with TabNine - 13. Juli 2021
- Building a Home Office Challenges App with Kafka, Kubernetes and StencilJS – Part 2: Introduction to Apache Kafka - 18. Januar 2021
Have you ever had to write a text, but didn’t know how to continue after the first sentence? Don’t worry, AI can fix that. Just go to this website, enter what you’ve got, and you will receive something like this:
|Our text: “As an IT consulting and software company, virtual7 GmbH develops solutions and IT applications for public sector clients.”
|AI: “We are able to fulfill a range of specialist roles, which is also reflected in our diverse employee base. After hiring more than 700 employees in our 10-year history, we currently employ about 500 full-time and part-time employees.”
Well, the generated text sounds as if it was written by a human, doesn’t it? But if you’re familiar with our company, you’ve probably noticed that there are a few tiny errors. Or perhaps the AI just wanted to show us our true potential…
The website uses the GPT language model, which was created to simulate natural language processing using neural networks.
GPT and Programming
Now, you probably ask yourself: Does this work for programming languages? As it turns out, GPT is pretty good at this, too. Don’t believe me? On this website, you are presented with a block of code, and you then have to guess if it was written by a human or an AI. Enjoy!
So, how can we make use of GPT in our daily work? Can we enter a line of code and let the AI do the rest? Or do we have to write code at all?
Let’s first have a look at SourceAI. It’s a code generator based on the most advanced version of GPT, GPT-3. All you have to do is choose a programming language. Then write down what you want the code to do – and it is generated automatically. Unfortunately, SourceAI hasn’t been released to the public yet, but the demos on the website already look very promising.
Fortunately, there is one other tool that you can already use today: TabNine is an AI-based autocompletion tool that is available as a plugin/extension for every major IDE.
Of course, all of these IDEs already come along with their own autocompletion tools. TabNine is just more… intelligent, as I will show you in the following paragraphs.
For example, you have just created a new object class in Java and defined all of its fields. Now you want to add a constructor which takes one argument for each field in the class. Just start typing, and after a while, TabNine will guess what you want to do, and offer to do it for you.
Or maybe you want to create several instances of a class in a repetitive manner. If you’re lucky, you just have to type in one letter until TabNine provides you with a helpful suggestion.
Of course, TabNine’s hints aren’t always as impressive as these cherry-picked examples. In most cases, it just works like a regular autocomplete tool and tells you how to finish the word you just started typing. And sometimes, its suggestions don’t make any sense at all. Still, there’s a good chance that it will increase your productivity. At least if you don’t get distracted by all those ‘How did it do THAT?’ moments.
Is it safe?
The learning data used for TabNine’s AI was taken from public code repositories, but it will use the code in your project as a basis for its suggestions. However, TabNine only runs locally on your computer. So, you can be sure that your code won’t be shared with anyone you don’t want to share it with.
A bigger issue might be that people let the AI generate the code without checking for possible bugs or security issues. That might not be such a big problem with rather basic tools like TabNine, which just finish one word, or one line of code, at a time. But if more sophisticated code generation software like SourceAI will one day enter the market, this could become a critical concern.
All things considered, we are probably still many years away from machines generating perfect code and replacing all software developers in the process. But as the power of AI increases, our work might undergo a significant change – from writing code ourselves to supervising the machines which do it for us. I, for one, welcome our new machine colleagues.