Hacker News new | ask | show | jobs
by fecs 1184 days ago
Hmm. This is not correct. Bard can write code.
5 comments

I tried and it was pretty awful.

This is the prompt I use, for which ChatGPT outputs a perfect program [0] on the first try (and can even convert it to use material-ui, with some prodding):

> Write a react program that I can paste into a codesandbox. It should display a counter that increases by one every second. Below the counter is a button, and when I press it, it decreases the counter by two. If pressing the button would result in the counter decreasing below zero, the button should be disabled.

Bard refuses to attempt it. It did attempt it for one variation of the prompt, but it used class components with an invalid render function and no timer; it looked like it was just pasting something from the first StackOverflow answer from a Google search of the prompt.

To be fair, Google isn't claiming to support this yet. But I'm just replying to the comment saying it can write code.

[0] https://codesandbox.io/s/prod-haze-c28sec

In the FAQ[1] it explicitly states that it cannot help you code. Maybe that's a limit of the prompt or just a limit of Google using a smaller/cheaper model? We'll have to test it out to see.

[1]: https://bard.google.com/faq

It looks like they have a filter, but it's pretty easy to get around depending on the language, e.g. I can get it to generate C++ code.
Bard faq says writing is not supported and that bard is still learning. I left with the impression that it can but maybe not well enough to have them even attempt to promote it as beta.
Can it? This was the response I got: "I'm designed solely to process and generate text, so I'm unable to assist you with that."
It can write code, but doesn’t seem very good at it and often refuses.