Code faster with AI using tabnine

 Background

Artificial Intelligence (AI) is getting infused into every sphere of our life. We find AI-powered smartphone cameras, devices, and voice assistants like Cortana, Alexa, Bixby, and various other alternatives. AI and Machine Learning (ML) is used to predict thing based on past patterns. In every industry, there are use cases related to AI and ML which can help improve people's lives in one way or the others.

One such area which is of keen interest is software developers. There are various studies done across the globe to improve developer productivity. Software developers spend a lot of time writing code and looking for information over the internet. We use things like code editors such as Notepad++, Sublime, Visual Studio Code, a full-blown integrated development environment such as Visual Studio Code, IntelliJ, PyCharm, Goland, Eclipse, Rider, etc., database connectivity tools, and many other things to get our work done. This involves context-switching between different tools depending on the type of application and the programming language or backend databases used for the application development. 

AI-powered assistant for developers

Many of the code snippets that we write are following a specific pattern. Some of the common examples are listed below

  • Query database table and fetch top 100 Orders, sort by highest order value
  • Perform sentiment analysis on a tweet / social media post
  • Make an API call to query some data
  • Write a function to find the average size of the basket from a given carts
These are just a few examples. But you can get a sense of the pattern that is being used. What varies is the programming language used and the syntax of the language. Nowadays it is possible to use Natural Language Processing (NLP) to specify the intent of what the code intends to do and let AI generate the code.

One such tool I came across is called tabnine. The tagline for tabnine says that it is an AI assistant for software developers. It helps developers to write code faster. It has two modes of operation. First is the single line mode where it recommends code for one single line. Ans second is the whole function code.

It integrates with the most common Integrated Development Environments (IDE) and supports most of modern-day programming languages and frameworks. The screenshots below list the IDEs and programming languages that it supports.


Refer to the install section to get the most updated list of IDEs and programming languages. If the language you are using or the IDE you are using is not on the list, most probably you are not working with a modern tech stack :)

My experience with Tabnine

I used Tabnine with my favorite code editor Visual Studio Code. I used it to generate C# code, document the project using Markdown files, and to write Powershell scripts. It was quite accurate in terms of its suggestions and recommendations with an accuracy rate of about 75-80%. It saved me quite a lot of time while writing the docs for a project. 

Although Markdown and Powershell are not listed in the supported languages, tabnine did a fantastic job in terms of proving context-aware recommendations.

I shared my experience of using Tabnine in a YouTube video.

Summary / Conclusion

Personally, I found Tabnine very useful. It avoided the context switching for me to look for information. It helped me to generate code faster. Documenting the code or project with markdown files was a breeze saving me at least 70% of the typing efforts. 

I think a tool like Tabnine can be very handy when we are learning a new programming language. It can help us quickly understand code syntax and best practices. The machine learning model used to train the assistant can scan different types of repositories within the organization as well as public repositories. This can help to implement best practices.

Hope you find this useful. I would love to hear about your experience.

Until next time, Code with Passion and Strive for Excellence.


Share:
spacer

No comments:

Post a Comment