CYBER MONDAY SALE: Get 50% off Tabnine!
Home / Blog /
Tips and tricks to best coding practices with Tabnine
//

Tips and tricks to best coding practices with Tabnine

//
Tabnine Team /
3 minutes /
June 14, 2023

One of Tabnine’s best features is that it works out of the box with no configuration required.

Tabnine seamlessly offers real-time code completions as you type, so you can enjoy its basic functionality without having to do anything special besides coding as usual. Nevertheless, there are a few strategies one can employ to optimize the results.

Install Tabnine on your chosen IDE

Make sure you accept Tabnine’s invitation email, then follow the instructions as you go. You can also refer to Tabnine’s Getting Started page if you get stuck, or contact our support team at support@tabnine.com

How to get Tabnine’s code suggestions

As you type, Tabnine AI coding assistant suggests code completions based on the context. To accept a suggestion, press Tab or Enter.

Code completion adapts to your pace as you code

Just keep typing and Tabnine will suggest code as you type. Hit Tab to accept a suggestion.

Choose the type of completions that best suit your needs and enhance your coding experience

Tabnine offers several types of code completions: 

  • On the fly: Real-time suggestions as you code (hit Tab to accept)
  • Full function: Type Enter and Tabnine will generate your entire function without exiting your editor
  • Natural language to code: Type // and describe the function you’re looking for, then press Enter

Tabnine uses existing code and natural language for context

The more context you give Tabnine, the better the code completions. Using Tabnine on an empty file might lead to somewhat “noisy” results. This context could come from open and interacted files, installed libraries, and the code and comments you’ve authored. The richer the context, the more precise and refined the code completion results will be.

Use descriptive function names and variables

Tabnine uses all the information in your editor as context, including both code and normal text. Giving functions and variables clear, descriptive names can help Tabnine predict more accurately. For instance, writing out a function signature gives Tabnine a good clue. Once you’ve named a function, press Enter.

Use comments as they would appear in real code

Tabnine can generate code from a comment. Simply write a comment, hit Enter, and Tabnine will generate the code for you. For example, you can write something like: “// connect to the database”. 

We don’t recommend asking questions like: “// Q: How do I connect to Mongodb?” Instead, keep it simple and write a comment the same way you always would.

How to trigger a code completion 

Tabnine has a slight delay built in so that it doesn’t trigger too often as you type. To trigger a code completion, we recommend pausing your typing for a few milliseconds. 

If you don’t like a suggestion provided by Tabnine, you can keep on typing and the suggestion will be updated automatically. If you find the suggestion distracting and want it to go away, just hit Escape.

Documentation lookup

Tabnine can also provide documentation lookup for functions and libraries. By selecting a suggestion and pressing the assigned key combination, you can access relevant documentation right within your code editor.

Customization

Tabnine allows you to customize its behavior according to your preferences. You can adjust the number of suggestions shown, enable or disable specific features, and fine-tune the model’s behavior to suit your coding style.

Feedback and reporting of issues

If you encounter any issues or have suggestions for improving Tabnine, please share them here. Providing feedback helps the developers enhance the tool and address any problems. 

Final note

As demonstrated in the examples above, Tabnine is a powerful tool that significantly enhances your productivity in various aspects of your daily tasks (and we’re constantly discovering new ones!).

To provide an even better experience and generate more accurate results, Tabnine’s dedicated team is constantly striving to improve and learn from our users. Witnessing and experiencing the evolution of AI-powered programming tools is truly exciting.

Feel free to send us feedback or questions to support@tabnine.com.