4 ms·
This made for extremely painful reading (I'm not blaming the author), but I couldn't imagine getting given code full of syntax errors by GPT-4 - then asking it
by alexellisuk 4y ago
This made for extremely painful reading (I'm not blaming the author), but I couldn't imagine getting given code full of syntax errors by GPT-4 - then asking it to correct them, only to get given more errors.
Co-pilot has been handy for generating structs and boilerplate code.
Where I think these models are currently interesting is in discovering conventions - libraries - approaches. Like an outline, which we know is probably broken - but enough for us to squint at and then write our own version.
Kind of like browsing an OSS repository to see "how it works" for inspiration.
Someone asked ChatGPT to write an OpenFaaS function for TTS - he needed to prompt it with the template name, and even then it got the handler format wrong. But it did show us a popular library in Python. To find the same with Google - we'd have to perhaps scan through 4-5 articles.
https://twitter.com/Julian_Riss/status/1641157076092108806?s=20 https://twitter.com/Julian_Riss/status/1641157076092108806?s...
- andybak 4y agoI think it depends on your personality - I prefer to fix code than to write it from scratch. Maybe it's an ADHD thing but I can be much more productive working like this than I can working in a void. (well - a void that has access to Stack Overflow etc)
- ghaff 4y agoIt's probably the same thing as with writing text. If you find starting from a blank page is anxiety-producing, a page of generated text may be useful even if you end up rewriting a lot of it. On the other hand, while ChatGPT is useful for some definitional boilerplate and some possibly correct listicle type of stuff, as an editor, it also guides you in a certain direction you may not want to go. I'm also used to being somewhat respectful of what humans have written, so long as it's not incorrect, even if it's not the way I would have written something.
- jhonof 4y ago> It's probably the same thing as with writing text. If you find starting from a blank page is anxiety-producing, a page of generated text may be useful even if you end up rewriting a lot of it. This is a pretty cogent insight, I much prefer having a draft of, for example, an email and then completely rewriting it, rather than starting an email from scratch. I'm not sure why, but it makes it seem much more approachable to me. That being said, I have found GPT-4 code not useful for anything but boilerplates or small functions. It often gets large blocks of code so wrong that it is just much faster to write it from scratch. What I have found useful so far is asking for a commented outline of what I'm asking for with just variable names filled in, but no implementation. It often gets that correct, and then I do the implementation correct.
- sh4rks 4y agoSame. Call me weird, but I actually enjoy reviewing and reading other people's code, because I'm good at spotting errors. When I code from scratch, I suffer from the programmer's equivalent of writer's block.
- workOrNah 4y agoKind of like browsing an OSS repository to see "how it works" for inspiration. And that's what sourcegraph.com is for
- ta988 4y agoSourcegraph is minimum $5k a year and the free version is wildly limited.
- taylorsperry 4y agoHey, PM at Sourcegraph here, we recently launched a new app. It's free and easier to set up, and it lets you sync both local code and remote repos. https://docs.sourcegraph.com/app https://docs.sourcegraph.com/app
- ta988 4y agoIntersting, I'll look into that. Thanks.
- bradgessler 4y agoYeah, the first back and forth with GPT-4 in the article were a bit tedious to write, but I chose that route to make the article more relevant to my recollection of what it was like as a beginner when I got an error in my code. A small part of me was hoping more experienced folks who read this would pickup on some level of tediousness, so it looks like that landed for some folks! There is def some tedium in GPT models. In practice, I’ll ask GPT-4 once about syntax errors. If it keeps getting them wrong I assume it doesn’t have the context it needs to solve the problem so I’ll either change up the prompt or move on to something else.