TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

92 pointsby ablyveiledalmost 2 years ago
Personally, GPT-4 has wasted about as much of my time as it&#x27;s saved with its constant hallucinations and lack of insight when writing NixOS derivations and a Rust web backend. I wouldn&#x27;t let it near my delicate-hackish checkpointing work in C++.<p>What are you doing where it serves you well?

65 comments

qingcharlesalmost 2 years ago
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&#x27;t get it quite right (which is why you need <i>some</i> knowledge of what you are asking of it) and I point it out and it fixes it.<p>Regular Expressions. I hate doing regexps. It is excellent at them.<p>Wiki articles for an encyclopedia I&#x27;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.<p>I know where to use it right, and I&#x27;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.
评论 #36037769 未加载
评论 #36037832 未加载
评论 #36037859 未加载
heliophobicdudealmost 2 years ago
Coding with LLMs was easier after understanding their limitations.<p>1. They don&#x27;t know what they are saying until they have said it.<p>2. Your inputs and its outputs help make the next message.<p>3. LLMs are not suited for information retrieval like databases and search engines.<p>LLMs excel at reasoning and predicting subsequent text based on given context. Their strength lies in their ability to generate relevant and cohesive responses.<p>To optimize results, outline clear rules, strategies, or ideas for the LLM to follow. This helps the model craft, revise, or build upon the established context.<p>Starting with a precise query and introducing rules or constraints incrementally can help steer the model&#x27;s output in the desired direction.<p>Avoid zero-shot queries as these can lead to the model generating unexpected or unrelated responses.<p>Be cautious while seeking pre-calculated or non-derived answers. Some instruction-tuned models might output incorrect solutions, as they are trained to respond to certain queries without proper context or information.<p>also, this is my biggest gripe no fault of ours of course: don&#x27;t seek pre-calculated or non-derived answers. I&#x27;ve seen some of the demonstration data that people are using to train instruction-tuned models and are being taught to respond by making up answers to solutions it shouldn&#x27;t try to compute. Btw, the output is wrong.<p>{ &quot;instruction&quot;: &quot;What would be the output of the following JavaScript snippet?&quot;, &quot;input&quot;: &quot;let area = 6 * 5;\nlet radius = area &#x2F; 3.14;&quot;, &quot;output&quot;: &quot;The output of the JavaScript snippet is the radius, which is 1.91.&quot; },<p><a href="https:&#x2F;&#x2F;github.com&#x2F;sahil280114&#x2F;codealpaca&#x2F;commit&#x2F;0d265112c705f88848783dfdf9bdca9df64d8e35#diff-0585315a2292ca9c3186c41e52ce9427a39b5f595d4bee6aae15e9443c95051bR25">https:&#x2F;&#x2F;github.com&#x2F;sahil280114&#x2F;codealpaca&#x2F;commit&#x2F;0d265112c70...</a>
potatoman22almost 2 years ago
I use it to brainstorm and prototype approaches to a problem. First, I&#x27;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&#x2F;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.<p>These models are good for ideation, scaffolding, and prototypes. It&#x27;s currently clumsy to fully build an app with an LLM, but they are quite useful for certain tasks.
评论 #36037884 未加载
hhhalmost 2 years ago
GPT-4 is amazing for me for writing Python, Go, and Kubernetes YAML.<p>I have designed and implemented 8 operators with between 90-100% of the code auto generated.<p>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.<p>I generate diagrams with high temperature, and code with low.<p>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.<p>I love having a partner to talk to about thoughts and design ideas while on walks using the ChatGPT app w&#x2F; transcription.<p>I have never felt more productive.
评论 #36187609 未加载
natoliniakalmost 2 years ago
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.
0gravitasalmost 2 years ago
It&#x27;s useful for rubberducking.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rubber_duck_debugging" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rubber_duck_debugging</a>
评论 #36037875 未加载
rtcode_ioalmost 2 years ago
<a href="https:&#x2F;&#x2F;RTEdge.net" rel="nofollow">https:&#x2F;&#x2F;RTEdge.net</a> was polished up in no time, thanks to its vast knowledge. If you&#x27;re knowledgeable in the field you ask questions about, it becomes a pure time save, as you can either just tell or test it.<p>It&#x27;s general world knowledge is also vastly impressive though.<p>It can draw a 2D representation of a keyboard key<p><pre><code> _____________ | | | Keycaps | |___________| | | | Key Switch| |___________| | | | Circuit | | Board | |___________| | | | Base | |___________| </code></pre> explain what happens at each layer when I press the key but more impressively also what happens if I spill cola over it:<p><pre><code> _____________ | | | Keycaps | --&gt; Coca-Cola makes the keys sticky |___________| | | | Key Switch| --&gt; The switch could become sticky, preventing it from registering key presses properly |___________| | | | Circuit | --&gt; The liquid could cause a short circuit, damaging the keyboard | Board | |___________| | | | Base | --&gt; Coca-Cola pools at the bottom, potentially leaking into the circuit board from below |___________|</code></pre>
评论 #36038854 未加载
评论 #36043526 未加载
dinvladalmost 2 years ago
You hit the nail on its head right there. It’s all based on a doomed technology that is not going to give us the benefits it promises. I do think future models will improve on this, but there’s likely very little room (read: data) left to make that happen.<p>Developing symbolic reasoning further would likely be a much better use of researchers’ time, even if it takes longer. But the incentives in the short term just aren’t there, sadly.
otoolepalmost 2 years ago
I&#x27;m the creator of rqlite[1], an open-source distributed database written in Go.<p>It&#x27;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: <a href="https:&#x2F;&#x2F;www.philipotoole.com&#x2F;what-did-gpt-4-find-wrong-with-the-rqlite-source-code&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.philipotoole.com&#x2F;what-did-gpt-4-find-wrong-with-...</a><p>That said, the most recent release of GPT-4 seems a little more buggy[2].<p>[1] <a href="https:&#x2F;&#x2F;www.rqlite.io" rel="nofollow">https:&#x2F;&#x2F;www.rqlite.io</a><p>[2] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35970711" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35970711</a>
评论 #36038669 未加载
评论 #36037792 未加载
siboehmalmost 2 years ago
1. It can do some reformatting tasks faster than I can do them by hand. Example: Inline FuncA into FuncB &lt;paste code for both functions&gt;.<p>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. &lt;paste error&gt; &lt;paste relevant code&gt;. Without the &quot;step-by-step&quot; approach it almost never works.<p>3. It&#x27;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.<p>4. It&#x27;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 &quot;round to nearest, ties to even&quot;. 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?.<p>5. It can explain assembly code. I dump plain objdump -S output into it.<p>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.
评论 #36037957 未加载
vitorbaptistaaalmost 2 years ago
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&#x27;ve never used Go. It gave me great answers, I think maybe once or twice the code didn&#x27;t compile (I used it dozens of times per day).<p>I&#x27;m now using the optimized Go code in production.
评论 #36044387 未加载
评论 #36038061 未加载
romlandalmost 2 years ago
I did this experiment (a game) to see what&#x27;s up and what&#x27;s down around all this: <a href="https:&#x2F;&#x2F;github.com&#x2F;romland&#x2F;llemmings">https:&#x2F;&#x2F;github.com&#x2F;romland&#x2F;llemmings</a>.<p>While there is some GPT4 in there, it&#x27;s mostly ChatGPT and a small handful of LLaMA solutions.<p>That project is a contrived scenario and not realistic, but I wanted to experiment with _exactly_ what you are talking about.<p>Very often I could have done things a lot faster myself, but there is one aspect that was actually helpful, and I did not foresee it. When inspiration gets a bit low and you&#x27;re not in the &quot;zone&quot;; throwing something into an LLM will very often give me a push to keep at it. Even if what is coming up is mostly grunt work.<p>The other day I threw together a script to show the commits in a reverse order and filter out (most of) the human commits (glue) over at <a href="https:&#x2F;&#x2F;llemmings.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;llemmings.com&#x2F;</a>
评论 #36038017 未加载
antidnanalmost 2 years ago
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.<p>I probably could have spent more time framing the query to get better results.
superjosealmost 2 years ago
I&#x27;ve been using it to generate code that follows certain pattern.<p>For example, I saved 2 hours. I told it to generate a GraphQL resolver after inferring a Zod schema.<p>It followed the code conventions from other file.<p>It generated it beautifully.<p>Every time there&#x27;s boilerplate, to ChatGPT it goes.
mcbuilderalmost 2 years ago
Writing in a language that I don&#x27;t know that well, but I know enough. Okay, my javascript isn&#x27;t the strongest, so I&#x27;d prolly have to spend 30-45 minutes just coming up to speed again on my basic AJAX and modern syntax, or BAM write a schema of my idea and get GPT to get my idea on paper with halfway decent style, syntax. I can take it from there.
cmpalmer52almost 2 years ago
One of the first things I tried (which I thought would be harder) was “Write a Python program that accepts a YouTube url and a start and stop time in the form MM:SS and a file name and it extracts the video between those times and converts it to an animated gif. Also provide a list of packages to be installed.”<p>The resulting code worked. Took an interaction or two to add usage info and tweak things, but it’s a neat little utility. Due to the libraries used, it was also simpler than I expected and would have been easy to write if I knew about those libs, so I also learned something.<p>It’s just one or two steps away from just saying “Go to this YouTube URL and extract the video between 3:20 and 3:27 into an animated GIF named ‘CatAndRaccoon.gif’” and having it write, debug, and execute the code.
FrostKiwialmost 2 years ago
Also had it hallucinate absolute garbage from time to time. The worst offender, that consistently shows up: Claiming there are certain library features, when there are not.<p>Easily the best rubber ducky though. Copy pasting big blocks of my own code and asking about it gives new perspectives to problems I am stuck on. Huge time saver in that regard.
评论 #36058283 未加载
评论 #36043920 未加载
honkycatalmost 2 years ago
I have found it completely fucking worthless for anything I have thrown at it.<p>Computing 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 &quot;lydian&quot; chord progression... it goes on and on.
评论 #36187972 未加载
scabbycakesalmost 2 years ago
I was writing code for a Raspberry Pico and a beginner at it. The Pico is hooked up to a little display with no documentation other than a few horrible convoluted and broken-english examples with hundred line functions, and I had no idea what to do to just display some things on this little screen.<p>So I simply dumped the code examples into ChatGPT and said &quot;Given these examples that display text and boxes on a screen, can we write a simpler interface and straightforward small functions for the display code?&quot;<p>And it was done.<p>This wasn&#x27;t code I wanted to mess with, I really just wanted to build my application rather than spend any time messing with the code to interact with this proprietary display. It was fantastic!
rsayersalmost 2 years ago
I let it write the boring stuff. Needed a python class to take an example dict, and generate a class that creates all the properties that map to the keys in said dict (I have a constraint preventing me from using something like json_dataclass or similar). While it&#x27;s churning that out, I can focus on other things.<p>Also found its great for regex, I&#x27;m pretty good with writing these, but recently came across a pretty complex one in our codebase that wasnt commented. Pasted into GPT4 and asked it to explain it, it broke down each bit in detail, and in the end even generated an example string that would match it.
collaborativealmost 2 years ago
AI has replaced 90% of my SO searches. I now don&#x27;t contribute anything back and have to trust unvetted code that tends to have defects<p>Coincidentally, SO seems to be worse. But then again, I only use it 10% of the time so I might be wrong
评论 #36188056 未加载
itaileibowitzalmost 2 years ago
I documented my process of building an email-auto responder with ChatGPT, not even GPT-4: <a href="https:&#x2F;&#x2F;dearai.substack.com&#x2F;p&#x2F;coding-gabrielle-six-chatgpt-superpowers" rel="nofollow">https:&#x2F;&#x2F;dearai.substack.com&#x2F;p&#x2F;coding-gabrielle-six-chatgpt-s...</a><p>I only have a little coding background, and ChatGPT didn&#x27;t make me an expert. But the collaborative Human+AI process did allow me to complete a project end-to-end, including figuring out where to host it and how to do that.<p>I found that it helped me with 6 &quot;superpowers&quot;: 1. Choosing between options (e.g., AWS vs. GCP vs. Zapier) 2. Walk me through it (e.g., how to set up a Firestore database) 3. Text-to-code (including simple nuisance calculations and code-to-code changes) 4. Help me out! (i.e., fixing broken code based on error messages) 5. Teach me (e.g., learning the difference between let, const, var, etc...) 6. Check my code (e.g., it caught errors before I even ran the code)<p>Check out the post for more details if you&#x27;d like!<p>There&#x27;s another post on building a website from scratch where I also tried Replit&#x27;s Ghostwriter. Yes, I faced a lot of frustrations in the process, but going from &quot;I can try struggle through this on my own&quot; to &quot;I actually have some help here that&#x27;s always available and usually right&quot; is amazing IMO.
bagelsalmost 2 years ago
Writing small python or bash utility one-off scripts to do various things.<p>For example, a utility to use the bitbucket api to dump all of the environment variables configured for a pipeline.
cmpalmer52almost 2 years ago
This one was using Bing AI chat:<p>I had a bunch of PDF files with coded file names, like ABC-123-abc-999-001.pdf, where each section of the file name was meaningful. Inside the PDF were several form fields. I needed to insert records in a database for each of the 97 files. Easy, but tedious.<p>I prompted it with a description of the file name breakdown, where the text to grab was in the PDF, and then asked for a Python program to find the files (in subdirectories), extract the PDF text, and write a text file with the SQL Insert statements for all the files.<p>It took two or three minor iterations, but less time than it would have taken me to write from scratch because my Python is rusty. Regular expressions, PDF processing libs, file system traversal, and SQL generation, and it all compiled and worked from the start (the iterations were to tweak a few things I didn’t specify).<p>This is the kind of thing that I think is perfect for these tools. With the new tools that let the LLM compile and execute code, it will be cool (and potentially dangerous).
mkmkalmost 2 years ago
Adobe automations are written in a truly bizarre language that, among other things, starts counting at 1 instead of 0. ChatGPT cheerfully obliges.
评论 #36038560 未加载
msteffenalmost 2 years ago
IME GPT-4 is bad at doing things and great at looking things up for you. Rather than trying to get it to do things, I ask it how I should do it (and argue with it about any hallucinations that come out—a process that often teaches me a lot!) and then I go do the task myself, copying whatever I need from the conversation but not relying on it slavishly.<p>It’s basically a fuzzy inverted index for public docs and code. “What’s the normal way of doing X”-type queries work best, with quality falling off quickly as complexity increases. Stuff like “what is a ‘git log’ command that only shows commits containing a particular snippet in the diff, limited to merge commits on master”, for example.<p>For more complex tasks, a trick I’ve seen work well is “give me an outline for how to do large task X” followed by “let’s go through each step in the above outline. For each one, I’d like a description of how it should be solved, including example code. Let’s start with the first step.” But that trick is not totally reliable and has its own complexity limit.
june_twentyalmost 2 years ago
Top tips:<p>* If you can write it from memory, go ahead and do so. Do not consult GPT-4<p>* 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<p>* If you&#x27;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
评论 #36037833 未加载
shepardrtcalmost 2 years ago
I&#x27;m great with backend software but not so great with frontend, so I had GPT4 write me a simple React app to test out some endpoint. Works really well. After the code was working, I pasted the app into it and asked it to make it &quot;more visually appealing&quot; and it did.
ygouzerhalmost 2 years ago
I use it to get more programming done, and take care of all the things that comes in the way:<p>A big client asked us to fill around 200 questions in an excel sheets, regarding our company security.<p>Then he asked for a cybersecurity standard document (like a big thing around 50 pages)<p>I took the previous excel sheet, removed noise, anonimized it. The n pass it to gpt3.5 to summarize for each security category (access management, code source security,...) the bulletpoints answering how do we implement that<p>To finish, I passed the bulletpoints for each category to gpt4, to write a nice bullshit document which sound more professional than me
grepfru_italmost 2 years ago
Autopatching vulnerabilities on my network.<p>I have a set of tools which build prompts describing the environment and the output of vulnerability scans. The tool then requests a shell script to disable&#x2F;fix&#x2F;update the vulnerability. The script is submitted as a PR which has actions that run integration tests. Human intervention is sometimes needed, but the focus is on better engineering of prompts (and by proxy tooling).<p>Describing the environment relies heavily on my CMDB (Combodo’s iTop) so this is not a one-size-fits-all approach and this is functioning entirely in my personal lab of ~100 servers. That said, ChatGPT has given me the best results compared to locally run LLMs
inawarministeralmost 2 years ago
I&#x27;ve been using it to refactor Clojure codes and port Scheme examples into Clojure.<p>Maybe because Lisps have very low syntax, I find I can just copy off function&#x2F;macro definitions as context and GPT3.5 can rewrite the code into something I can use... And by testing in a REPL (in :dev) I can instantly see which code has hallucinations and which work perfectly.<p>Tbh I find it hallucinates mainly when dealing with mutable states (e.g. atoms) or with pipelines of complex maps transformed by multimethods -<p>Just using small data bits and normal pure functions make GPT3.5 work perfectly because it doesn&#x27;t need to take into account code outside the 2048-4096 tokens it&#x27;s thinking right now?
评论 #36057277 未加载
andythemoronalmost 2 years ago
I&#x27;m launching a financial planning business right now but I was recently using it to write xpath queries to use with &quot;xmllint --format&quot;.<p>I then used it to generate a more robust Python script processing these large XML files instead.<p>I like using it to generate scaffolding and for debugging but I haven&#x27;t had to touch a legacy C++ code base for a few years.
radoshialmost 2 years ago
I’m using it to do the mundane tasks of unit testing and (some) documentation. I find that the code it spits out isn’t perfect but getting some boiler plate and fixing it up is pretty fast compared to writing from scratch.<p>I’ve used this enough that I wrapped some cli glue around it and wrote <a href="https:&#x2F;&#x2F;github.com&#x2F;radoshi&#x2F;llm-code">https:&#x2F;&#x2F;github.com&#x2F;radoshi&#x2F;llm-code</a><p>I’ve used this mostly to write Python and bash, with some Makefiles and Dockerfiles thrown in.<p>GPT-4 is better, albeit slower, than 3.5-turbo. HTH!
jweiralmost 2 years ago
Text categorization for podcasts.<p>The prompt asks for specific aspects from a podcast - people, dates, locations - score them by relevance and count the occurrences. Now, GPT can&#x27;t count for a damn, but it is a useful proxy. The relevance score is pretty good.<p>There are existing services that can do this, but with GPT and the API I don&#x27;t need to read a manual and I define exactly what format I want back.<p>This is what is exciting - GPT will format its responses to _my_ requirements, not the other way around.
belvalalmost 2 years ago
OpenSearch (or ElasticSearch) query building. I was new to the technology and their syntax took a while to wrap my head around. Instead I&#x27;d just tell ChatGPT my document format and then ask for specific data in natural language.<p>Fair warning, the queries were not always perfect on first try, but it was a lot easier than parsing replies to somewhat similar questions on stack overflow. Now I mostly write my own queries but it really helped me get started.
0xmmoustafaalmost 2 years ago
I&#x27;m using it for single file programs and building command line utilities, it excels at building apps from scratch, but struggles to follow code it didn&#x27;t write.<p>I&#x27;ve had so much success that I built my own command line utility (<a href="https:&#x2F;&#x2F;github.com&#x2F;0xmmo&#x2F;codemancer">https:&#x2F;&#x2F;github.com&#x2F;0xmmo&#x2F;codemancer</a>) to use in the VSCode terminal and my side projects are now ~70% written by LLM.
hereforcommentsalmost 2 years ago
When 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&#x27;s surprisingly good at it.<p>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).
bcuzcombinatoralmost 2 years ago
Charts on charts on charts<p>I&#x27;ve converted from an excel wiz to python, but making charts was always the bane of my existence in python, until GPT. And I personally use 3.5 more than 4 because of the speed, but I used 4 when I need something critical or I know I need it to balance multiple thoughts.
zamnosalmost 2 years ago
Given a 2021 cutoff, I&#x27;m not surprised that rust and Nix are too new for it to do well with. I&#x27;ve been using it to avoid actually learning what manifest.json looks like for Chrome extensions.<p>One thing that helps is telling it it&#x27;s wrong or missing a case or whatever. It&#x27;ll type out a fix (assuming it understands, which it frequently does) faster than I can.
wdrwalmost 2 years ago
It&#x27;s great at log pocessing (generating commands for awk, sed, complex grep regexps, shell scripts to combine it all). Anything where I&#x27;m not an expert but need something very basic done quickly (e.g. the bulk of my day job is in C++, but I frequently need little bits of Python and ChatGPT is often the quickest way to get the answer I need).
Kim_Bruningalmost 2 years ago
Ha, yeah, GPT* sucks for nixos. I think this is due to<p>* NixOS development being pretty high paced, [with certain developments (like flakes) post-dating the original GPT cutoff still?]<p>* Documentation being slow to show up on the internet.<p>* Just in general lower popularity (than windows or ubuntu or etc) leading to less data for ChatGPT to pick up on.
pseudosavantalmost 2 years ago
I&#x27;ve used it a lot for experimenting with new frameworks I haven&#x27;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.
pridkettalmost 2 years ago
I know how to program. I understand lisp. What I have problems with are all the built in functions and variables in emacs-lisp. It has dramatically improved the readability of my emacs configuration and also taught me about some new ways to do stuff in emacs (and when to stop because I can’t do something).
space_fountainalmost 2 years ago
I&#x27;ve used it to SPARQL query to explore wikdata data a bit. I&#x27;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
bestcoder69almost 2 years ago
Today 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&#x2F;C++). First attempt was wrong, so I had it write test code to debug. Using the test output it fixed the code afterward.
antimoraalmost 2 years ago
I use it as a sound board to think out. Also it&#x27;s helpful in certain programming tasks that I am not familiar with but popular in certain circles. It&#x27;s great to get up to speed in knowledge without reading tons of articles or wikipedia.
iLoveOncallalmost 2 years ago
It works well for non-programming tasks, writing the bullshit career development I&#x27;m forced to write and crap like this. It&#x27;s absolutely useless for software development though.<p>I just use Amazon CodeWhisperer as a nice autocomplete but that&#x27;s it.
评论 #36037818 未加载
Cicero22almost 2 years ago
I find that it&#x27;s great at creating a starting point for react components, using material ui components. Generally, I find it more helpful to review the code it produces than to produce it myself on the first pass.
alexmaykinalmost 2 years ago
Optimizing SQL queries. Give GPT-4 a Postgresql EXPLAIN output together with the query and it gives very nice results (you do need to iterate a bit). Has steered us in a better direction quite a few times now.
Jack000almost 2 years ago
Here&#x27;s roughly how my conversation with GPT4 went<p>Me: I want to make an svg editor, give me some suggestions. I mainly want something with mobile support.<p>GPT4: gives me some options<p>I look over the options and choose fabricjs<p>Me: Start by loading an svg at a predefined url<p>GPT4: &lt;code&gt;<p>Me: Ok now implement a save feature, send the json to this url ...<p>GPT4: &lt;code&gt;<p>Me: The text is loaded as an image, I want the text to be editable<p>GPT4: &lt;code&gt;<p>Me: I&#x27;d like to add some google fonts to the text editor<p>GPT4: &lt;code&gt;<p>Me: The fonts aren&#x27;t loading, I think we need to load the fonts first before initializing the canvas.<p>GPT4: &lt;code&gt;<p>Me: Ok add a undo&#x2F;redo feature<p>GPT4: &lt;code&gt;<p>Me: Let&#x27;s add some clickable buttons instead of hotkeys, here is the html..<p>GPT4: &lt;code&gt;<p>I probably could have done this myself, but frankly it would have taken me a long time to figure out the fabricjs api. It probably saved me at least a week making this thing.<p>here&#x27;s the live app: <a href="https:&#x2F;&#x2F;tinyurl.com&#x2F;2dhh58cn" rel="nofollow">https:&#x2F;&#x2F;tinyurl.com&#x2F;2dhh58cn</a><p>and the code: <a href="https:&#x2F;&#x2F;tinyurl.com&#x2F;2tu4xrtn" rel="nofollow">https:&#x2F;&#x2F;tinyurl.com&#x2F;2tu4xrtn</a><p>you can tell the GPT generated sections by the (overly) verbose comments
armatavalmost 2 years ago
TypeScript 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.
repleralmost 2 years ago
I had it write a regex for me the other day. It was super convenient!<p>I just didn’t feel like looking up the language specific regex syntax I needed and poring over the verbose examples for an hour.<p>Worked perfectly.
Sabrezulualmost 2 years ago
I use it for complex terraform (hcl2) dictionary&#x2F;list comprehension... Give it a sample input, then the desired output... Works wonders!
markisusalmost 2 years ago
I 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.
khqcalmost 2 years ago
I&#x27;ve been using it to do image processing in opencv, it&#x27;s saved a lot of time I would&#x27;ve spent figuring out the required transforms and matrix operations
airbreatheralmost 2 years ago
I got it to generate ladder logic for a PLC, and translate from Siemens to Allen-Bradley.<p>Trick is you tell it you are going to import&#x2F;export with XML files and it works in them.
FpUseralmost 2 years ago
Snippets of code in multiple languages, generic help like what Linux command &#x2F; sequence &#x2F; options do I use to do this and that &#x2F; etc. Serves me well.
braindead_inalmost 2 years ago
I am trying to build react apps with TDD. I&#x27;ve successfully built a todo app with just prompting. Add more features to it now.
aristofunalmost 2 years ago
I offload dumb tasks to it like bash oneliners or small pieces of code refactorings<p>Essentially it is an advanced autocomplete.
paddwalmost 2 years ago
It is great for any type of shell scripting. Also works well for quickly fleshing out type definitions
cliffwardenalmost 2 years ago
Logql queries for Grafana. Explaining regex in plain english and having to translate it
markm248almost 2 years ago
It&#x27;s really good at generating sample data and reformatting.
crisnoblealmost 2 years ago
writing regexes
perfmodealmost 2 years ago
converting code from php to Go
tangentstormalmost 2 years ago
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.<p>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&#x27;s knowledge was quite a bit out of date.<p>I actually filmed that whole interaction here:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TFsbMGSOeCY">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=TFsbMGSOeCY</a><p>I also was able to get it to make a working (though extremely basic&#x2F;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.)<p>Since then, I&#x27;ve stumbled on the technique of presenting it with a rough plan or idea and then iteratively having it ask <i>ME</i> questions about what I posted, and summarizing everything we&#x27;ve agreed so far, rather than just immediately writing code. I find that it&#x27;s actually pretty good at pointing out things I hadn&#x27;t considered (security and scaling questions, for example), and asking for clarification.<p>Most recencly, I&#x27;ve started using it to help me get past the learning curve in languages where I&#x27;m not fluent at all (making an animation in Mathematica, and discovering how to do some simple things in smalltalk).<p>In general, I try to ask it for the most minimal&#x2F;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 &quot;we&quot; worked out &quot;together&quot; 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.<p>Aside from that, I&#x27;ve used ChatGPT <i>3</i> in a non-chatting context through GitHub Copilot, and that is a whole other ballgame: it&#x27;s basically a plugin for Visual Studio Code that acts like a super-smart autocomplete.<p>It doesn&#x27;t always guess what I&#x27;m about to type correctly right, and the wrong suggestions are occasionally annoying when I&#x27;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 <i>exactly</i>, including my sometimes unusual code formatting choices...)<p>I&#x27;m still on the waitlist for copilot chat, which presumably is just ChatGPT but insta-trained on your codebase... I&#x27;m very much looking forward to trying it, though.