Live data from Hacker News

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

news.ycombinator.com

1–10 of 109 posts

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

#1
Personally, GPT-4 has wasted about as much of my time as it's saved with its constant hallucinations and lack of insight when writing NixOS derivations and a Rust web backend. I wouldn't let it near my delicate-hackish checkpointing work in C++.

What are you doing where it serves you well?

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

#2
It works well for non-programming tasks, writing the bullshit career development I'm forced to write and crap like this. It's absolutely useless for software development though.

I just use Amazon CodeWhisperer as a nice autocomplete but that's it.

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

#3
SQL queries. I am poor at writing SQL queries with bunches of joins. I just show it the table definitions and tell it what I want. Sometimes it doesn't get it quite right (which is why you need some knowledge of what you are asking of it) and I point it out and it fixes it.

Regular Expressions. I hate doing regexps. It is excellent at them.

Wiki articles for an encyclopedia I'm developing. It is great at this, but occasionally I catch it hallucinating articles out of whole cloth because it has access to zero information about what I asked it about, so it just goes from the article title and imagines what it must be about.

I know where to use it right, and I've found my output has not only doubled since I started using it, I am enjoying coding even more than ever because it has got rid of the worst drudgery that would cause me to switch from my IDE to my browser and bring up HN to avoid working.

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

#4
It has saved me some time writing queries in some obscure DSLs. Results were slightly off but close enough for me to run with it. Replaced my first pass of reading through the docs, but not really helpful beyond that.

I probably could have spent more time framing the query to get better results.

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

#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 use the same prompting approach as (2.) for generating microbenchmarks.

4. It's pretty useful for explaining things to me that I then validate later via Google. Example (I had previously tried and failed to Google the answer): The default IEEE rounding mode is called "round to nearest, ties to even". However all large floating point numbers are even. So how is it decided whether 3,000,003 (which is not representable in fp32) becomes 3,000,002 or 3,000,004?.

5. It can explain assembly code. I dump plain objdump -S output into it.

The main limitation seems to be UI. chat.openai.com is horrible for editing large prompts. I wrote some scripts myself to support file-based history, command substitution etc.

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

#7
I use it as a personal tutor. It is really good at it, because it can respond to clarifying follow up questions and it is usually right. For pure development or peer review, it is not there yet. I asked it recently to help me decipher some real life SQL performance issues and it did not really help. Actually, it turned out to be a waste of time. The classic Postgres query analyzer and some 3rd party query visualization tools got the job done.

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

#8
I had to optimize some Python code to reduce its memory usage. After trying all ideas I could think of, I thought about rewriting it in a different language. Copied and pasted the code into ChatGPT 4. Tried Rust at first, but there were too many compilation errors. Then I tried Go and it worked perfectly. For the next couple of weeks, I used it to improve the Go code, as I've never used Go. It gave me great answers, I think maybe once or twice the code didn't compile (I used it dozens of times per day).

I'm now using the optimized Go code in production.

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

#10
I'm the creator of rqlite[1], an open-source distributed database written in Go.

It's saving me time (sometimes 2x speed up on certain, well-specified, tasks), and I enjoy using it. I wrote a blog post with some details on how it has helped me code the database: https://www.philipotoole.com/what-did-gpt-4-find-wrong-with-...

That said, the most recent release of GPT-4 seems a little more buggy[2].

[1] https://www.rqlite.io

[2] https://news.ycombinator.com/item?id=35970711

Post reply on HN