Google gives Bard the ability to generate and debug code

Google’s Bard chatbot now has the ability to help you with programming tasks. The tech giant said that coding has been a top user request of it, and now it has given Bard the ability to generate, debug and explain code. Bard can now write in 20 programming languages, including C++, Java, JavaScript, and Python. It now also has integration with other Google products and can export code to Colab, the company’s cloud-based notebook environment for Python, as well as help users write functions for Sheets.

In addition to being able to generate code, Bard can now provide explanations for code snippets. It could be especially useful if you’re just starting to learn programming, as it will show you why a particular block has the output it does. And yes, Bard can now also help you debug code that isn’t working the way you want it to.

Google admits that at this point, Bard could spit out code that “doesn’t produce the expected result” or code that is incomplete. The tech giant advises to double check and test your answers first. In fact, Bard can debug its own output if it finds that it’s returning an error; just write “this code didn’t work, please fix it”. Finally, if you are not a programming beginner but still need help, you can ask the chatbot to optimize your code by making it faster or more efficient.

A screenshot showing how the Google Bard can help you debug your code.


The tech giant opened up access to its AI chatbot in March, though it still has a ways to go to catch up with the popularity ChatGPT enjoys today. To note, ChatGPT also has the ability to write and improve existing code in various programming languages, so Google giving Bard the ability is perhaps inevitable. Google has been constantly improving Bard in other ways as well, and previously rolled out updates driven by a new language model called PaLM. A few days ago, the company created an “experiment updates” page where you can see all the changes Bard has gone through as it adds even more features and makes bug fixes.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button