You are one tool away from becoming a 10x developer! 🚀
Tags: productivity, vscode, ai, webdev
Published: 2023-02-24 17:59:00

## Introduction

Hello everyone 👋. I hope you're all doing well. I recently posted an [article](https://dev.to/developeratul/how-to-use-chatgpt-to-boost-your-developer-productivity-3e5a) about how to use ChatGPT to increase your development efficiency. I was recently introduced to [Bito AI](https://bito.co/) and am amazed by its ability to help developers to increase their efficiency. Today's article will introduce you to Bito AI and demonstrate how you may use it to become a 10x developer or at least save a couple of hours a day. Let’s begin.

---

## What is Bito AI 🤔

Bito AI is an AI assistant integrated right into your editor. It uses ChatGPT under the hood. But it is specially trained on billions and millions of code to get the best answer for your question, it’s pretty incredible what [Bito AI](https://bito.co/) can help you do without having to search the web. It has the following capabilities:

- ☝️ Command Syntax
- 🥇 Test Cases
- 🔑 Explain code
- 🔥 Generate Code
- ✍️ Comment Method
- ⚡ Improve Performance
- 🔒 Check Security

Bito’s AI Assistant is like a Swiss Army knife that can do so many things – and make you that elusive 10x developer! It works right in your favorite IDE (we support Visual Studio Code and all JetBrains IDEs like IntelliJ, PyCharm, GoLand, etc) and is also available as a Chrome Extension.

This product was launched recently. The maintainers are constantly working to improve it. They recently added a bunch of shortcut options and keyboard shortcuts. They have also done a lot around prompt engineering to get you the best answer with no work on your part.

- Check out their [official website](https://bito.co).
- Download their [VS code extension](https://marketplace.visualstudio.com/items?itemName=Bito.Bito)

Now, let’s talk about how to utilize this tool to increase productivity.

## How Can Bito AI Be Used to Boost Developer Productivity?

Bito AI works similarly to ChatGPT, but it is integrated directly into your IDE. So you can stay focused. I have it in my VS code setup. I follow a three-column layout in my VS Code editor, which makes using this tool extremely enjoyable.

![Bito AI on VS Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iaexpungi4pmjibiy3wj.png)

If you have opened Bito AI, It is now available in your context menu.

![Btio AI in VS code context menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qrukjap7kjvqyumer1ve.png)

Let’s go over some of them one by one to give you a demo.

### 🔥 Generate Code

You can ask Bito any technical question, and it will answer it while also writing code. I'll ask it how to use nodemailer to send emails in nodejs. And this is the response I got.

```jsx
// To send an email using the nodemailer module in nodejs, you will need to install the nodemailer package first. After that, add the following code to your nodejs app:

const nodemailer = require("nodemailer");
let transporter = nodemailer.createTransport({
  service: "gmail",
  auth: {
    user: "your-email-address@gmail.com", // REPLACE WITH YOUR EMAIL ADDRESS
    pass: "your-password", // REPLACE WITH YOUR PASSWORD
  },
});
let mailOptions = {
  from: "your-email-address@gmail.com", // REPLACE WITH YOUR EMAIL ADDRESS
  to: "recipient-email-address@gmail.com", // REPLACE WITH RECIPIENT'S EMAIL ADDRESS
  subject: "Your Subject Line",
  text: "Your message goes here!",
};
transporter.sendMail(mailOptions, function (err, data) {
  if (err) {
    console.log("Error occurs");
  } else {
    console.log("Email sent!");
  }
});
```

This is the optimal solution to the question I asked. It saved me a lot of time and provided the most accurate solution while I was in my editor.

### 🪜 Explain Steps

Bito can explain the procedure of your code. All you have to do is just select the portion of your code you want it to explain by steps and then click on `Explain Steps` as shown in the previous screenshot. For a simple example, I will ask it to explain this code below:

```jsx
const handleToggleAnswer = () => {
  if (label === "") return;

  if (["MCQ", "TRUE-OR-FALSE"].includes(type)) {
    form.setFieldValue("answers", [label]);
  } else if (type === "CHECKBOXES") {
    // if the answer is already included in the list remove it
    // otherwise add it. just like how checkboxes work
    if (answers.includes(label)) {
      const filteredAnswers = answers.filter((answer) => answer !== label);
      form.setFieldValue("answers", filteredAnswers);
    } else {
      form.setFieldValue("answers", [...answers, label]);
    }
  }
};
```

Here’s what response I got:

```
1. The code is defining a function named handleToggleAnswer.
2. It is using an if statement to check if the label is an empty string. If it is, the function will return.
3. The next if statement is using the Array.includes() method to check if the type is either "MCQ" or "TRUE-OR-FALSE". If it is, the form's field value of answers will be set to the label.
4. If the type is "CHECKBOXES", the code will use the Array.includes() method to check if the answers array includes the label.
5. If it does, the code will use the Array.filter() method to create a new array with all the answers except for the label. This filtered array will be set as the form's field value of answers.
6. If the label is not in the answers array, the code will use the spread operator to add the label to the answers array and set it as the form's field value of answers.
```

![Bito AI explaining code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yb84h8v9zqedrb14ah1m.png)

Excellent and clear response. I truly loved the syntax highlighting feature that they released a few days ago.

### ✍️ Generate Comment

Bito AI can also generate comments for your code. I use this feature whenever I'm finished writing a function and want to document it. Let’s try generating a comment for the same code that we just wrote:

```jsx
const handleToggleAnswer = () => {
  if (label === "") return;

  if (["MCQ", "TRUE-OR-FALSE"].includes(type)) {
    form.setFieldValue("answers", [label]);
  } else if (type === "CHECKBOXES") {
    // if the answer is already included in the list remove it
    // otherwise add it. just like how checkboxes work
    if (answers.includes(label)) {
      const filteredAnswers = answers.filter((answer) => answer !== label);
      form.setFieldValue("answers", filteredAnswers);
    } else {
      form.setFieldValue("answers", [...answers, label]);
    }
  }
};
```

Here’s the response that I got:

```jsx
// This function handles the toggle of the answer when a user interacts with the form. If the label is empty, no action is taken. For MCQ and TRUE-OR-FALSE types, the label is set as the answer. For CHECKBOXES types, the label is added or removed from the answers array based on whether it is already included or not.
```

Excellent!

### ⚡ Performance Check

I have written a function that takes in a number, n, and returns the sum of all numbers from 0 to n.

```jsx
function sum(n) {
  let result = 0;
  for (let i = 0; i < n; i++) {
    result += i;
  }
  return result;
}
```

To improve the performance of the code, we could use a math formula. Let’s see if Bito AI can figure it out and fix the performance of this code. Here’s the response:

```
Code Performance Issues:
1. This code is inefficient because it uses a loop to add all the numbers from 0 to n. This is a time-consuming process that can be improved by using a mathematical formula.
 Rewritten Code:
function sum(n) {
  return n * (n + 1) / 2;
}
```

I must say I am beyond impressed with Bito AI! It saved me from a lot of headaches being right in my editor!

![Bito AI fixing performance issues](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m54aiucsgrme6uvmjwxv.png)

### 🔒 Security Check

You can eliminate potential security issues in your code by using Bito. Let’s check the security status of the function we wrote previously. Here’s the response:

```
Code Security Issues:
1. No input validation: The code does not check if the input given is valid or not.
 Rewritten Code:
function sum(n) {
  if (n < 0 || typeof n !== 'number') {
    return 'Please enter a valid number';
  }
  let result = 0;
  for (let i = 0; i < n; i++) {
    result += i;
  }
  return result;
}
```

Doing input validation is very important for writing secure and bug-free code. Bito did that for me.

---

## Summary

Overall, Bito is an amazing tool to have as a developer. It can do things that ChatGPT can do. But as a developer, having it right in your editor is much more productive and saves a lot of time. I showed you the features that I love. It has way more features than that. They have amazing features for teams. They are coming soon with a diff view of the IDEs. So you can compare the code you selected and that Bito fixed and then automatically accept the changes. I would highly encourage you to download their [VS code extension](https://marketplace.visualstudio.com/items?itemName=Bito.Bito) and get your hands dirty with Bito. I am pretty sure you will love it. Let me know what you think about this tool 👇.

## Conclusion

That's all for now. Hope you got value from this article. If you did, make sure you like it. Follow me on [Twitter](http://twitter.com/developeratul) to get daily updates. Thank you so much for reading and I will see you in the next one. ✌️

## Follow me on social 🌐

### 👤 Minhazur Rahman Ratul

- Twitter ([@developeratul](https://twitter.com/developeratul))
- Github ([@developeratul](http://github.com/developeratul))