Google's Bard AI can now write code - here's how to use it

Google Bard on phone with Google logo in background
(Image credit: Shutterstock)

Google is not resting on its laurels when it comes to improving its Google Bard AI. After supercharging its math abilities earlier this month, Bard has now had a coding lesson too. 

In a press release, Group Project Manager for Google Research Paige Bailey confirmed the additional features added to the chatbot. “Starting now, Bard can help with programming and software development tasks, including code generation, debugging and code explanation.” 

This is, of course, a great way for developers to create code quickly and also get a second pair of ‘eyes’ on existing work to spot any errors. 

Coders can choose from 20+ different coding languages too, including C++, Go, Java, Javascript, Python, and Typescript. If you don’t know where to start, newbie coders can also use Bard to explain snippets of code to them in terms they understand.

Bailey does understandably caveat for keen coders that Bard is still an experiment and, “when it comes to coding, Bard may give you working code that doesn’t produce the expected output, or provide you with code that is not optimal or incomplete.” Before using any code from Bard, it's obviously sensible to double-check and test it. Bard can even fix its own code if prompted.

This improvement is a major closing of the gap between Bard and ChatGPT and proves even with the upcoming Project Magi, Google is pushing new features into Bard. For example, another addition is the confirmation that, “If Bard quotes at length from an existing open-source project, it will cite the source.”  That's something we preferred about ChatGPT in our comparison of the two

How will you be able to write code with Google Bard? 

Programmer sitting at a laptop and monitors

(Image credit: Shutterstock)

The great thing about coding with chatbots like ChatGPT and Google Bard is you won’t need background knowledge in programming to log in and get started. You simply have to know what prompt to provide the AI and a basic understanding of how to use Google Bard.

Getting the best results from AI for a task is all about being specific, much like a search engine. Telling the AI exactly what you want and what language to use is crucial. For example, don’t say, “Code me a game” try “Code me a pong-style game in Python” instead and see what comes back at you. 

Once you’ve got the first round of code, make sure to optimize it. Again, this can be done with little technical knowledge because of the way conversational AI is set up. You can, for instance, ask Bard “can you make that faster?” or “can you fix any errors you’ve missed?”

It will, of course, be trial and error at first. And we haven't had a chance to test Bard's coding skills first hand. But, once we've given it a try, we'll make sure to report back with our findings. 

How long until we see the first AAA blockbuster game or killer app created by an AI?

More from Tom's Guide

TOPICS

Andy is a freelance writer with a passion for streaming and VPNs. Based in the U.K., he originally cut his teeth at Tom's Guide as a Trainee Writer before moving to cover all things tech and streaming at T3. Outside of work, his passions are movies, football (soccer) and Formula 1. He is also something of an amateur screenwriter having studied creative writing at university.

Read more
Gemini Code Assist gif
Google launches AI-powered coding for free – here’s how to try it
Grok 2
I just created a video game using Grok — here's how
ChatGPT vs Gemini
I put Gemini vs ChatGPT to the test with 7 prompts — here's the winner
GitHub Copilot
Microsoft just made Github Copilot free — here’s why it's a big deal
ChatGPT
ChatGPT Tasks turns the AI chatbot into a productivity platform — 3 tips to get more out of it
Programmer sitting at a laptop and monitors
I created over a dozen personal apps using AI in 60 days, here's what I learned
Latest in Google Gemini
A stock photo of a person on their phone looking at a spreadsheet while several graphs are displayed on the laptop in front of them.
Google Sheets just got an AI upgrade that analyzes your data and visualizes it
Gemini logo shown on a phone's screen
Google Gemini can now analyze and summarize documents for free — here's how
Gemini Live
Gemini Live major upgrade just revealed by Google
Gemini 2
Google Gemini 2.0 is now free for users — here’s how to access it now
Gemini 2
My browser tabs were getting out of hand so I let Gemini 2.0 takeover — here's how it went
Claude vs Gemini
I tested Gemini vs Claude with 7 prompts to find the best AI chatbot — here's the winner
Latest in News
Apple Intelligence logo on iPhone
Apple confirms Siri 2.0 is delayed — 'it’s going to take us longer than we thought'
NYTimes Connections
NYT Connections today hints and answers — Saturday, March 8 (#636)
MacBook Air M4 vs. MacBook Air M1
MacBook Air M4 vs MacBook Air M1: 7 biggest upgrades
Switch 2 and Mario
Nintendo Switch 2 FCC filing just revealed Wi-Fi 6 and NFC — but that's not all
iPhone 17 Pro render
iPhone 17 Pro Max and iPhone 17 Air designs just teased in new video — here's your first look
Harry Maguire of Manchester United in action during a Premier League match in February 2025
Man Utd vs Arsenal live stream: How to watch the Premier League game online