Ask HN: Those with success using GPT-4 for programming – what are you doing?
21–30 of 109 posts
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#22Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#23SQL 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 oc…
Here's an example of one that helped me a lot. This takes no time at all to get ChatGPT to generate by giving it anonymized snippets of table data saying:
"here's an example of the relevant tables, I want output that looks like this, what query does that?"
and it just works instantly.
ChatGPT did NOT format it this way, I changed the line breaks and indentation formatting to better fit viewing in Chrome/Safari. I also renamed tables/columns out of personal responsibility, to generic names which make it all the more confusing.
-- Existing Records
WITH search_table_A AS (
SELECT * FROM tableA
WHERE some_primary_key = :searchKey
),
search_table_B AS (
SELECT * FROM tableB
WHERE some_primary_key = :searchKey
),
combined_query AS (
SELECT COALESCE(search_table_A.our_UUID, search_table_B.our_UUID) AS our_UUID
FROM search_table_A
LEFT JOIN search_table_B ON search_table_A.some_primary_key = search_table_B.some_primary_key
)
SELECT tableC.*
FROM tableC
JOIN combined_query ON tableC.our_UUID = combined_query.our_UUID;Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#24Computing how to dilute a concentrate into a fruit punch, how to create and render a template in golang, how to parse an int in golang, what makes a chord progression a "lydian" chord progression... it goes on and on.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#25Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#26* 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
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#27I'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.rql…
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#28For example, a utility to use the bitbucket api to dump all of the environment variables configured for a pipeline.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#29I'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.rql…
Reading your blogpost it wasn't clear to me how you ran your code through GPT-4. Which prompts did you use?
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 that helpful, digesting the feedback from GPT-4 made me think more about my code, and make some changes for the better.