Skip to main content

Google Bard can now write, debug, and explain code 

Following math and logic enhancements last month, Google has updated Bard to generate code, as well as debug and explain it. The company says this can “help you by offering new ways to write code, create test cases, or update APIs.”

With new coding capabilities, we’re excited to apply generative AI to accelerate software development, inspire innovation, and help people solve complex engineering challenges.

Google Bard will now accept code prompts with support for over 20 programming languages, including C++, Go, Java, Javascript, Python, and Typescript. With Python, you can export code to Google Colab without copying and pasting. Another integration lets Bard assist you with writing functions in Google Sheets.

New code debugging functionality even works for code that Bard wrote:

If Bard gives you an error message or code that doesn’t do what you intended, just tell Bard “this code didn’t work, please fix it,” and Bard can help you debug.

Besides writing, Bard can explain code snippets, which Google positions as being helpful for those learning or “if you need some additional support to understand what a block of code might output.”

Bard will cite the source if it “quotes at length from an existing open source project.”

  • Google Bard code
  • Google Bard code

In adding this capability, Google reminds users that Bard is an “early experiment.” This means that Bard can “give you working code that doesn’t produce the expected output, or provide you with code that is not optimal or incomplete.”

Always double-check Bard’s responses and carefully test and review code for errors, bugs and vulnerabilities before relying on it.

More on Google Bard:

FTC: We use income earning auto affiliate links. More.

You’re reading 9to5Google — experts who break news about Google and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Google on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel

Comments

Author

Avatar for Abner Li Abner Li

Editor-in-chief. Interested in the minutiae of Google and Alphabet. Tips/talk: abner@9to5g.com