Live data from Hacker News

Ask HN: Those with success using GPT-4 for programming – what are you doing?

news.ycombinator.com

51–60 of 109 posts

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#51
GPT-4 is amazing for me for writing Python, Go, and Kubernetes YAML.

I have designed and implemented 8 operators with between 90-100% of the code auto generated.

I use it to generate mermaid diagrams that implement the first 3 layers of the C4 model, sometimes needing some editing or guidance to modify it, then have it generate the code.

I generate diagrams with high temperature, and code with low.

That’s my experience. I have a coworker using ChatGPT Plus (gpt-4), and they fail to get anything working. It’s not zero effort, but how I think generally aligns with the model I think.

I love having a partner to talk to about thoughts and design ideas while on walks using the ChatGPT app w/ transcription.

I have never felt more productive.

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#52
Text categorization for podcasts.

The prompt asks for specific aspects from a podcast - people, dates, locations - score them by relevance and count the occurrences. Now, GPT can't count for a damn, but it is a useful proxy. The relevance score is pretty good.

There are existing services that can do this, but with GPT and the API I don't need to read a manual and I define exactly what format I want back.

This is what is exciting - GPT will format its responses to _my_ requirements, not the other way around.

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#53
post #36

Earlier quoted context omitted.

>"If you can write it from memory, go ahead and do so." I know how to for example divide and multiply on paper. Still I use calculator for that.

You seem to be saying that you're getting a speed-up even in the first case, i.e. where you can write the code without having to think hard or look anything up. If so, how do you do it?

You got it mixed up. Yes I can write some code (multiply on paper) without looking it up but it will be slower than asking GPT and then doing cut and paste with maybe some little editing.

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#54
I was able to get ChatGPT 4 to produce a working websocket server in rust fairly quickly I know rust but had no experience with the networking crates or async runtimes.

Getting it to also serve HTTP, it fell into quite a few issues. Part of it was not telling me I needed to enable a feature, and part of it was that it's knowledge was quite a bit out of date.

I actually filmed that whole interaction here:

https://www.youtube.com/watch?v=TFsbMGSOeCY

I also was able to get it to make a working (though extremely basic/naive) SAT solver in J. J is pretty far out of the mainstream, so I had to go through MANY rounds of correcting it. (That was the only time I used up all my ChatGPT4 prompt quota for the 3-hour period.)

Since then, I've stumbled on the technique of presenting it with a rough plan or idea and then iteratively having it ask ME questions about what I posted, and summarizing everything we've agreed so far, rather than just immediately writing code. I find that it's actually pretty good at pointing out things I hadn't considered (security and scaling questions, for example), and asking for clarification.

Most recencly, I've started using it to help me get past the learning curve in languages where I'm not fluent at all (making an animation in Mathematica, and discovering how to do some simple things in smalltalk).

In general, I try to ask it for the most minimal/general example it can give me that shows what I actually want to know. For example, building on the rust web server thing, I asked it to give me the structure for building a restful API with certain endpoints (which "we" worked out "together" using the iterative design discussion method) but just leave the implementations blank, because they would be un-necessary detail for it, and I already knew how to do that part.

Aside from that, I've used ChatGPT 3 in a non-chatting context through GitHub Copilot, and that is a whole other ballgame: it's basically a plugin for Visual Studio Code that acts like a super-smart autocomplete.

It doesn't always guess what I'm about to type correctly right, and the wrong suggestions are occasionally annoying when I'm pausing to think through how to word a comment... But very often now when I start to write a function, several whole lines that were just a vague idea in my head suddenly appear on my screen exactly as I would have written them. (And I mean exactly, including my sometimes unusual code formatting choices...)

I'm still on the waitlist for copilot chat, which presumably is just ChatGPT but insta-trained on your codebase... I'm very much looking forward to trying it, though.

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#55
AI has replaced 90% of my SO searches. I now don't contribute anything back and have to trust unvetted code that tends to have defects

Coincidentally, SO seems to be worse. But then again, I only use it 10% of the time so I might be wrong

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#56
post #36

Top tips: * If you can write it from memory, go ahead and do so. Do not consult GPT-4 * If you know what to do but need to look a few things up - put your best effort into GPT-4. It will flesh it out * If you're using a library that is new, you can copy paste the library examples into GPT-4 and then describe what you want to do. It will give a great starting point

>"If you can write it from memory, go ahead and do so." I know how to for example divide and multiply on paper. Still I use calculator for that.

My calculator has never given me a wrong answer, so I trust and use it. Every time I have used ChatGPT to solve a coding problem it has had missed important edge cases or been flat out wrong. I find most tasks significantly faster to do myself, but I have found inspiration in a wrong answer that ChatGPT has given me.

Maybe it's good at trivial stuff, but then I don't need it for trivial stuff so why use it then. This example is more like saying you'd use a calculator to solve (5 / 10) when it's faster to solve that yourself.

Now if I was just learning my times tables, sure I'd use ChatGPT, but once I've learned them it's not helping me on the basics anymore, and may be actively hindering me.

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#59
post #29
post #27

Earlier quoted context omitted.

Reading your blogpost it wasn't clear to me how you ran your code through GPT-4. Which prompts did you use?

I brought up the web UI, and said something like this: "Here is a Go source file, see any problems, issues, or suggested bug fixes? " Simple as that. Of course, sometimes I got the "message too big" error. So I pasted bits of the sources files, choosing pieces I thought were reasonably self-contained. I also fed much of my unit tests through it, asking "see any missing test cases?" While some of the answers were not…

Nice, that's simple enough! You may want to try talking to it via the API, last time I checked the web UI doesn't accept prompts >4K tokens while GPT-4 via the API has a 8K Token limit. And then there's the 32K version...

Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?

#60
post #6

1. It can do some reformatting tasks faster than I can do them by hand. Example: Inline FuncA into FuncB . 2. For more complicated tasks it requires good prompting. Example: Tell me three ways to fix this error, then pick the best way and implement it. . Without the "step-by-step" approach it almost never works. 3. It's pretty good at writing microbenchmarks for C++. They always compile, but require some editing. I u…

But 3000003 is exact in fp32, as well as it is 3000002.5, 3000002.75 before it or 3000003.25, 3000003.5, 3000003.75 after it?

https://www.h-schmidt.net/FloatConverter/IEEE754.html

And AFAIK the LLMs, lacking the ability to actually calculate, can't check which numbers are such?

Post reply on HN