Ask HN: Those with success using GPT-4 for programming – what are you doing?
11–20 of 109 posts
I've used it to SPARQL query to explore wikdata data a bit. I'm about at the breakeven point where hallucinations mean it would be worth it to just learn the language, but I think it clearly saved me time to write some simple queries without knowing the language at all
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#12It is great for any type of shell scripting. Also works well for quickly fleshing out type definitions
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#13I had it write a regex for me the other day. It was super convenient!
I just didn’t feel like looking up the language specific regex syntax I needed and poring over the verbose examples for an hour.
Worked perfectly.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#14TypeScript and React - I feel like it’s good enough to get the ball rolling on some annoyingly complex topic like flick-to-animate drawers; but once it’s got a scaffold I can usually take on the rest.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#15When I finish writing a method, function or larger chunk of code that works well but could be simplified or optimized, I ask it do it and it's surprisingly good at it.
Sometimes I ask it to write complete classes for me. My longest prompt was full page long and it wrote a county-city autocomplete from a database: the back end in Go, the front end in plain vanilla JS with a non-jQuery based lightweight library (I asked it).
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#16I use it as a sound board to think out. Also it's helpful in certain programming tasks that I am not familiar with but popular in certain circles. It's great to get up to speed in knowledge without reading tons of articles or wikipedia.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#17I've used it a lot for experimenting with new frameworks I haven't used. I recently used it to do a project in Deno with Oak and wasm-dom. It got me 90% of the way with a very accurate bullet point list of what it needed to do. It makes me think about the function of my code a lot more than the exact code representation of it.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#18I use it to brainstorm and prototype approaches to a problem. First, I'll ask it to give me an overview of the problem domain; this gives the LLM context. Then, I describe the problem and ask it to generate solutions, along with pros/cons of each approach. This is iterative: you might ask it questions, modify its suggestions, periodically summarize. After that, you can either ask it to give you code for a prototype or build it yourself.
These models are good for ideation, scaffolding, and prototypes. It's currently clumsy to fully build an app with an LLM, but they are quite useful for certain tasks.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#19Today I used it to rewrite a function in llama.cpp that compiled in gcc9 but not gcc7 (an avx2 intrinsic wasn’t available… idk specifics, I barely know C/C++). First attempt was wrong, so I had it write test code to debug. Using the test output it fixed the code afterward.
Re: Ask HN: Those with success using GPT-4 for programming – what are you doing?
#20I had a bunch of matrices dumped by a Matlab script that I needed to paste into a Python script. I asked ChatGTP to write a sed script to reformat the matrices into numpy arrays.