Google gives Bard the ability to generate and debug code
Aside from being able to generate code, Bard can now provide explanations for snippets of code. It could be especially useful if you’ve only just started learning programming, since it will show you why a particular block has the output that it has. And yes, Bard can now also help you debug code that isn’t quite working like you want it to.
Google admits that at this point, Bard might spit out code that “doesn’t produce the expected output” or code that’s incomplete. The tech giant advises double-checking and testing its responses first. In fact, Bard can debug its own output if you find that it’s returning an error — just type in “this code didn’t work, please fix it.” Finally, if you’re not a programming beginner but still need a help of help, you can ask the chatbot to optimize your code by making it faster or more efficient.
The tech giant opened up access to its AI chatbot in March, though it still has a ways to go to reach the popularity that ChatGPT is enjoying today. To note, ChatGPT has the ability to write and improve existing code in several programming languages, as well, so Google giving Bard the capability is perhaps inevitable. Google has also been constantly improving Bard in other ways and previously rolled out upgrades powered 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 performs bug fixes.