Google just announced an update to Bard that now provides assistance for programming and software development tasks, such as code generation, debugging, and clarification.
An animated GIF showcases text illustrating how “Bard can assist you”: debug your code, generate documentation and tutorials, clarify your code line by line, and convert code between programming languages.
Since the launch of Bard, our cutting-edge AI collaboration tool, users have frequently requested coding support. As a product leader at Google Research and a devoted engineer who codes daily, I’m thrilled to introduce this feature in Bard.
Effective immediately, Bard can aid with various programming and software development tasks, including code generation, debugging, and code clarification. These features are available in over 20 programming languages, such as C++, Go, Java, Javascript, Python, and Typescript. Additionally, Python code can be effortlessly exported to Google Colab, eliminating the need for manual copying and pasting. Bard can even help write functions for Google Sheets.
Bard can also clarify code snippets, which is particularly useful for beginners or those needing extra support to understand code outputs.
Additionally, Bard can help you debug code, even if it was generated by Bard itself. If Bard provides an error message or non-functional code, simply tell Bard “this code didn’t work, please fix it,” and Bard will assist in debugging.
It is important to note that Bard is still in its early stages and may occasionally provide incorrect, misleading, or false information with confidence. When using Bard for coding, it may generate functional code that does not yield the expected results, or provide suboptimal or incomplete code. Always double-check Bard’s responses and thoroughly test and review code for errors, bugs, and vulnerabilities before relying on it. However, we believe Bard’s new features can offer innovative ways to write code, create test cases, and update APIs. If Bard quotes extensively from an existing open-source project, it will cite the source.
In many cases, Bard can also help optimize your code by enhancing its speed or efficiency. Simply respond to Bard’s initial output with “Could you please make that code faster?” or “Identify error handling clauses you might have missed.”
Bard is already assisting users with everyday tasks, such as crafting presentations, writing lesson plans, inventing new recipes, or planning workout routines. With the introduction of coding capabilities, we are eager to apply generative AI to accelerate software development, inspire innovation, and help users tackle complex engineering challenges.