PCMag editors select and review products independently. If you buy through affiliate links, we may earn commissions, which help support our testing.

Google Bard Can Now Help You Write Code in Over 20 Programming Languages

The chatbot will also debug code, explain what code does, and even speed up code if asked.

 & Matthew Humphries Former Senior Editor

Our team tests, rates, and reviews more than 1,500 products each year to help you make better buying decisions and get more from technology.

Our Expert
LOOK INSIDE PC LABS HOW WE TEST
65 EXPERTS
43 YEARS
41,500+ REVIEWS

Google's ChatGPT competitor Bard gained a new skill today: the ability to help us write and debug code in more than 20 different programming languages.

As Paige Bailey, Group Product Manager at Google Research, explains in a blog post, "Starting now, Bard can help with programming and software development tasks, including code generation, debugging and code explanation."

Bard's programming skills extend to more than 20 languages, including popular languages such as C++, Go, Java, JavaScript, Python, Typescript, and even Google Sheets functions. Python code can also be exported to Google Colab without needing to copy-paste it, allowing for easy code execution in your web browser.

If the code produced throws any error messages, Bard will help debug it if you tell the chatbot "this code didn’t work, please fix it." If you don't understand a piece of code, Bard will explain it, and you can ask it to look at specific pieces of code. For example, you could ask Bard to "tell me about the code within the google/jax GitHub repo." And if a piece of code is too slow for your needs, simply ask Bard "Could you please make that code faster?" and it will get to work speeding it up,

Bailey says Bard's code generation, debugging, and explanation ability "is particularly helpful if you’re learning about programming for the first time." However, Google is keen to remind us Bard is still just an early experiment and can produce "inaccurate, misleading or false information while presenting it confidently."

Anyone worried about the code Bard produces being quoted verbatim from an existing open source project without citing the source can relax. Google says citation will be included if Bard quotes at length from a project.

About Our Expert

Matthew Humphries

Matthew Humphries

Former Senior Editor

My Experience

I started working at PCMag in November 2016, covering all areas of technology and video game news. Before that I spent nearly 15 years working at Geek.com as a writer and editor. I also spent the first six years after leaving university as a professional game designer working with Disney, Games Workshop, 20th Century Fox, and Vivendi.

I hold two degrees: a Bachelor's degree in Computer Science and a Master's degree in Games Development. My first book, Make Your Own Pixel Art, is available from all good book shops.

My Areas of Expertise

  • PC components and system building
  • Raspberry Pi
  • Software development
  • Storage technology
  • Video games and gaming hardware

Read full bio