Live data from Hacker News

Ask HN: Can ChatGPT generate fully functional code?

news.ycombinator.com

1–10 of 69 posts

Ask HN: Can ChatGPT generate fully functional code?

#1
Fellow members,

I'm curious to know what are some of the best prompts to use on ChatGPT to understand its full-fledged capability as a newbie developer.

One of the things I noticed, is that it produces the requested code in the cleanest manner but it's not complete. For instance, I tried the prompt - "give me the python code for TicTacToe Game" and the code produced was incomplete.

Have you all encountered the same or my prompt is inappropriate?

Re: Ask HN: Can ChatGPT generate fully functional code?

#2
YEs, but in small blocks and with specific asks. I asked it to generate code based on an existing project of mine, which generates analytics from social media activity. It does a good job of producing function bodies from prompts equivalent to a short comment you might use to document your function in the IDE.

For your example, I'd ask it to 'generate code, using Python, that accepts input and updates a display to allow a user to play an interactive game of TicTacToe with the computer.' I'm sure I could do better with some experimentation, but that will have to wait for some other day.

Re: Ask HN: Can ChatGPT generate fully functional code?

#5
Someone on /r/rust is currently marveling that it spit out a working bitmap allocator: https://reddit.com/r/rust/comments/zgkuq6/

ChatGPT is sensitive to how you prompt it, and it's designed to work as a dialogue where you ask further questions and it can refine its answer.

It can already write reasonable working code, although you shouldn't expect it to spit out entire working programs when the prompt is Gimme Teh Codez without further details. That being said, AI capabilities only get better with time, so I think it'd be shortsighted to dismiss its potential because of its current limitations.

If the pace keeps up, companies with access to large language models in a few years could have a large advantage on legacy programming, the same way programmers in high-level languages have a massive productivity advantage on 1970's low-level assembly programmers. You give up a little more control, but you save time.

Re: Ask HN: Can ChatGPT generate fully functional code?

#8
It all depends on what you mean by generate fully functional code. In my experience, it is able to generate code snippets that are useful but very rarely can be simply copy & pasted into your work. The experience is actually quite similar to Stack Overflow.

Re: Ask HN: Can ChatGPT generate fully functional code?

#10

Take a look at this: https://www.dropbox.com/s/gq2hkp7w37c5y6q/ai.png?dl=0

Oh my! It does not really matter if this is actually self-aware, but in terms of productivity: well it has the potential to be revolutionary. No longer does a person need to know how to program. Just talk to a computer and the computer will generate the code to execute such task.
Post reply on HN