Hacker News new | past | comments | ask | show | jobs | submit login
ChatGPT Changed How I Write Software (readysetcloud.io)
27 points by dlb007 on June 11, 2023 | hide | past | favorite | 46 comments



Yeah I'm not convinced. As usual with most pro-ChatGPT posts I see, there is little to no actual useful information on how to use ChatGPT practically.

When I read one of these articles or posts, I usually expect to see concrete prompts, their output, and how they can be used to speed up development. Instead all I see is generic vagueisms; "it helps me write unit tests", "it helps me code faster", or in the case of this article "it’s taken over how I plan, design, and implement software." with little to no real examples of how this works. It almost feels like people want to brag that they've discovered "the secret sauce" rather than help others understand how to use it.

I've tried multiple times now to use ChatGPT. In every case ChatGPT has produced code that has bugs, needs to be double checked, or simply straight up doesn't work. It IS impressive how it's able to create code that seemingly does what you ask, and it's lightyears ahead of other products, but in no way have I found it to be a gamechanger. IMHO, at best it might steer me in the right direction, and at worst it completely wastes my time. Seems pretty overhyped to me.


I'm in the same boat I have yet to find an actual use case for chatgpt beyond a google/stackoverflow search that uses the same variable names as my code.

In several occasions it has produced code that took me longer to fix than just reading the documentation and in almost all of those cases it couldn't help me find the issue and I actually had to read the documentation anyway (it took just seconds to pinpoint the missing clue).

Something it seems really good at is unix commands (regexes, awk expressions, pipes and bash intricacies) so I do use it a fair bit for that.


I use it (GPT4) to explore ideas. Come up with names, explore domains i'm unfamiliar with, etc - all while assuming everything is wrong and i need to validate everything. Which is basically the same as Google/etc. I just use it as a frontend for Search, generally.

I don't use it to write anything concrete, i have not found it to be good at that. I also use FastGPT (Kagi's GPT) as a .. faster search frontend. FastGPT fails to find stuff frequently but it also is so damn fast it feels faster than me searching+clicking_link+skimming_page.

I also like ChatGPT for exploring APIs which i may not know, but can easily validate. It's wrong often, but when i can validate it's not a big deal, and what i get out of it is the ability to Q&A. I find API documentation frequently frustrating because while i prefer documentation, i frequently don't know how to get to my answer. Documentation often feels like i need to read the entirety of everything before i can reliably get any answer, and frankly i'm impatient. GPT gives me a more interactive exploration of content. It either knows the answer, or can often point me in the direction to find it myself.

All this is to say ChatGPT & friends have not revolutionized my work. Hell during my day job i rarely use it because it's a domain i know well. But i do have the belief that it helps me enough to justify the cost, currently.


Yeah, I can see it being "worth the cost", especially since the cost isn't high. It surely does not "transform" or "revolutionize" the way programmers work though; unless programmers in question were simply thoughtlessly assembling snippets from StackOverflow anyway.


I've gotten pretty good at getting ChatGPT to do what I want. I wrote about it here, https://zchry.org/words/building-a-brand-identity-with-code, but that's probably still light on details for you.

There really isn't any magic bullet I don't think, every case is unique and involves a lot of trial and error. The original prompt was something as simple as "You're going to help me build a plugin for figma that draws Lissajous Curves". It starts with telling you how to setup the Figma plugin folder structure (which Figma makes super easy), installing all the dependencies / npm etc. From there, it was just a lot of going back and forth with ChatGPT fixing the bugs until it compiled cleanly (files we worked with: code.ts, manifest.json, tsconfig.json, ui.html), then going through the bugs that would be thrown in the app console when you actually ran the plugin.

Eventually though, everything worked great and Figma even approved the plugin to be published publicly.

My best piece of advice is that when I feel really far off where I want to be, I just start over from scratch and rework my prompts to more accurately guide ChatGPT in what I want.

And lastly, now that I have a basic "baseline" of how I want ChatGPT to help me with these plugins, I give it all that information up front and try it keep it in that predefined scope.


Off topic, this is super impressive website. Thanks for sharing.


Thank you!


I had a complex depth-first recursive reducer that I wanted to change to iterative but was struggling to fully grock and implement myself. I tried Chat GPT 3.5 and it failed miserably. I sent the recursive code to a coworker who has Chat GPT-4 and not only did it create an iterative solution correctly on the first prompt, it pointed out that the original code had an off-by-one error that occurrs in only 1/128 of cases, and due to compounding rounding, manifests in real world situations even less often.

So GPT 3.5 is great for doing trivial things I already know how to do AND describe accurately, things I'd ask a junior engineer to tackle, but GPT 4 seems to be able to do things I struggle with. I'll probably subscribe now.


> As usual with most pro-ChatGPT posts I see, there is little to no actual useful information on how to use ChatGPT practically.

I feel the same way, and my (maybe a bit paranoid) take is that many of those posts are also written by ChatGPT. After all, if someone is excited about the tool, of course they'll also use it as much as possible. In that case it also makes sense that there are never any practical examples since the training data is from pre-GPT times.


I don't have any super concrete examples, but I can confirm it _helps_ in writing software for me.

Things it has helped with, that are now part of a codebase I work in and get paid for.

Generated example css to center a text element onto a sibling image. I'm decent at css, but I didn't know I could do this easily. This definitely saved me a decent amount of time

Write some boilerplate react hook wrapping over an axios request. Something along the lines of "Write a React hook to make a request to ..., using these parameters ... Return ..."

The one that I've probably used most is "Write a MySQL query to ..., these are my schemas: {COPY PASTE RELEVANT TABLE SCHEMAS". I can write MySQL queries just fine, but getting one with some decently complex calculations takes me some time. GPT-4 gets very close most of the time. For exploring the database GPT really has helped save me quite some time. I just don't now MySQL as well as I do my primary languages like TypeScript, PHP and Python so this is a godsend.

Otherwise, I also use it a decent amount in some other scenarios. The Phpstorm plugin I have gives me a right-click menu that pastes my code in a chatGPT window. It has stuff like

1. Refactor

2. Explain

3. Write docs

4. Write a custom prompt

I use these a lot. They save me a decent amount of time. They're super quick to access right in my IDE. In some cases using the "Refactor" command, GPT-4 gives better results than myself. I found that it doesn't really make typos in making sure variable names and stuff stay the same, and it also doesn't mess up control flow which I sometimes do. And yes, this is an admission that I do sometimes refactor without tests, I'm working on it :x


Does the ChatGPT plugin for PHPStorm actually analyze your existing code? As-in... can you ask it to code something using your pre-existing utility functions, classes, and so on?


The one I use is CodeGPT. It doesn't. It's a simple chat-like wrapper over the GPT4 api.


I use ChatGPT (4) to generate a lot of unit tests. The prompt is usually no more complicated than “Write comprehensive unit tests using <insert testing framework here> for this” and then I paste in the class/function to test


Yeah the author dragged this out for basically no value at all. Anyone who has done programming for the last 5+ years has figured out ChatGPT inside and out.


to back up the author: I'll use ChatGPT with the GPT4 model and it mostly just works by simply asking it to do what I want, the same way I might ask another person.

The main constraints I see right now are around 1) complex projects that don't fit into the token context, and 2) keeping up a "base prompt background info" to describe the general purpose of your program and the technical stack.

Issues I've run into:

1) Sometimes it will do things in a "bad" style and you need to correct it. For example overusing callbacks in code that should use async/await. for JavaScript.

2) Subtle errors around types that the vs code compiler can catch and enable you to fix

3) It doesn't seem to consider execution time, so I've seen it produce wildly inefficient code


For issues 1 and 3, I usually have success asking ChatGPT to correct them. Ie "Can you write this with fewer callbacks using async/await?" or "Can you make this code faster to execute?"


Right that's what I mean, it requires "fiddling" to resolve. I think these could both be solved with a larger context, where you could include a style guide.


Thanks, I misunderstood.

> I think these could both be solved with a larger context, where you could include a style guide.

Hm, I'm not so sure. If you tell ChatGPT that good code has something wrong with it, it will overcorrect by modifying the working code, usually making it worse or even breaking it!

IMO, this is where you need a human in the loop, to recognize the deficiency and tell ChatGPT what to correct. Maybe in GPT-6 that won't be necessary and human programmers will be obsolete, but not today.


It helps if you don't know what you're doing. If you know what you're doing it just adds friction.

This is actually not intuitive but should not be surprising since the perfect specification for code is well... code


I think trying to force ChatGPT into your workflow is the wrong approach and will lead to lackluster results. I personally believe Copilot is a much better tool since it seamlessly integrates and most of the utility comes when you least expect it.

Copilot has also made it easier to actually know in what situations I should actively reach for ChatGPT or Copilot Chat and they are way different than the ones I thought it would be.


This is exactly what my experience has been. I've also seen way too many people downplay the hallucinations or anthropomorphize the technology.


GPT-4 is considerably better than the free version. And I find it hard to believe that whichever model you used has been wrong 100% of the time.


For those looking for specific examples of useful code being authored by AI, you can check out Promptr:

https://github.com/ferrislucas/promptr

The README links to example PR’s comprised of commits written by GPT4. The prompts used to produce the code are noted in the commit messages.


Have you tried GPT-4? Its at least an order of magnitude better than 3.5,and has rarely produced code that doesn't compile for me. The difference is night and day.


My problem with GPT-4 so far is that it's most impressive at doing things that I don't really need any help with, but when I ask it something that I find genuinely challenging, it's error prone and often generates suboptimal code. Of course, it's an extreme far cry from Markov chains and earlier models, but at the end of the day, I think it's skipping too many steps right now.

To be clear, it's still really impressive. Being able to ask an AI assistant to implement e.g. a Fourier transform in Rust and getting an answer that is correct or quite close is pretty damn impressive. That's something that a lot of programmers would struggle with. But, in a lot of other ways, GPT-4 feels very skin deep, and the illusion is pierced when you realize it has just made a bunch of shit up in its impressive-sounding answer.


> My problem with GPT-4 so far is that it's most impressive at doing things that I don't really need any help with

That's actually what I like about it. It's pretty good at doing routine tasks that I easily could do, but which are boring and/or time-consuming. That frees me up to do more interesting stuff.

One example I've given here before is porting an extension I wrote for the Atom text editor to VS Code. I have no doubt that I could learn to write extensions for VS Code, but using ChatGPT meant that I didn't have to waste hours learning how to do that. I just took the skeleton code generated by ChatGPT, dropped in my pre-existing code, and boom... done. Since learning to write VS Code extensions isn't my primary goal (or a secondary goal, or even a tertiary goal), that was a clear win for me.

I put off switching to VS Code for far too long after Atom was EOLed, just because I didn't want to take the time to learn how to port my extension.


I think things you don't need help with are exactly the good case where it shines. You give it some context, and get back working (or close to it) code - make any modifications necessary and ask it to generate unit tests. It's easy to validate and saves you 15-30 mins or more.

Half the time I ask it for help with something completely foreign and I can't properly diagnose or fix the issues - without taking the time to read the docs and/or looking it up on Reddit or stackoverflow. The other half of the time it works perfectly-ish.

I don't know about you guys - but a lot of shit I write is not a world-changing problem - if it's something already asked on stackoverflow - you basically get a code block that does what you need, with your variables and comments and unit tests already pretty much done.


I've definitely given it a try for some of that, but the truth is I just don't have that many greenfield projects. Most of my work is maintaining existing code, and CoPilot/GPT-4 haven't proven as useful for me at that.

When it comes to new, greenfield projects, I really do try to be ambitious generally speaking, and this leads me into trouble. I gave it a try to see if it could generate code for something where I needed just a slightly tricky data structure maneuver. It was a nicely self-contained problem, pretty much ideal for this sort of thing, but it still generated code that didn't compile and wasn't optimal.

To be fair, it was kinda close, which is great. But overall it wasn't worth the time: I'm pretty slow, but most of my time is NOT in trying to implement basic things, it's trying to come up with what I need to implement in the first place. So I definitely tried spitballing with GPT-4 a little bit to try to get an idea of whether or not that was a good idea. Truth is, it's a bit hit-or-miss.

Here's my take:

- For programming tasks, it's just skipping too much stuff. I think the future for LLMs doing complex tasks is definitely going to depend heavily on huge context windows and approaches like langchain. That said, I think today you still can't really get something that resembles a "self-driving" robot programmer, because it's just lacking the depth necessary.

- For language tasks, it's fantastic. When it comes to language tasks, it really doesn't feel like it's skipping anything, it feels like it has a genuine understanding of language. I'm not sure if we're there yet, but I am hopeful for the future of machine translation using LLMs: You can't talk to Google Translate about the context your string will be used in, but you CAN do that for GPT-4, and while I'm not really fluent in any language aside from English, cross-checking its work, I think it's at least a lot better than what you can currently do using DeepL and Google Translate for common languages. (To be fair, even LLaMA finetunes have been SHOCKINGLY useful for this use case in my experience. They hallucinate a bit too much to be useful, but the fact that the hallucinations usually seem to lie close to the answer leaves me impressed given that it's a several GiB bundle of data on my SSD that runs on CPU only.)

Also, GPT-4 is just going to be epic for people learning new things. I am enthusiastically excited about the ability to just auto-generate some example code for some kind of thing I'm not familiar with. Even if it's nearly useless, it can probably get you pointed in the right direction and learning what terms you need to google for.


Yes GPT4 is marginally better, no it doesn't significantly change its usefulness for software development. It still misunderstands questions and tasks, it still forgets or ignores constraints almost immediately, it still uses libraries that don't exist, it still generates tons of plausible-sounding but ultimately flawed code that wastes more time than it saves (unless you couldn't code your way out of a wet paper bag to begin with).

It makes for a decent rubber duck and it can aid you in exploring the space of unknown unknowns when approaching a new subject, but that's about it in my experience.


That hasn't been my experience at all - on the other hand I wouldn't consider myself an exceptional programmer so maybe it's more helpful to me day-to-day, but it has certainly saved me many hours so far.

GPT4 is definitely more than marginally better than GPT3.5


I'm sure others will reply with their own, but I can give you several examples where it specifically sped up some of my development. I'll start with just the one though, because otherwise this could get quite long.

As a weekend project I did a DSL for helping to interact with LLM's called Prompt (prlang.com), kinda like an declarative LangChain. The language is unimportant, what is important is that syntax highlighting is just one of those things that people expect a language to have now, and every editor wants to do it differently. Figuring out syntax highlighting is one of those super tedious things that makes writing a DSL very boring. ChatGPT4 is very good at translating from one language to another though, and so I could use it to help me write the vim syntax file (I don't know VimScript at all) and then translate it to other editors as necessary.

To get specific, it helped me write this vimscript file:

https://github.com/PromptProgrammingLanguage/prompt/blob/mas...

and then with almost no editing from me turned it into another syntax highlighting file (for hljs) that's used on the website.

https://github.com/PromptProgrammingLanguage/PromptProgrammi...

I don't know how long that would have taken me to figure out on my own, but diving into VimScripts docs, and then the HL.js docs, and fully reading and comprehending them would have been a total slog. Doing it with ChatGPT4, I could keep open the docs for Vim, ask it questions about how to do something, then quickly reference the docs to cross check if it was telling the truth, write, and then test the syntax in a very quick loop. Then the process of translating what I had to another library was incredibly fast, if I recall it misplaced one line while translating, which was thankfully obvious, and that was it. I didn't read the docs for hl.js at all.

ChatGPT is definitely better at some tasks than others. Anything that takes shallow knowledge of your specific code base, but broad knowledge of the wider languages ecosystem, is a good fit for it's use.

I could give a more impressive example of where it helped me tackle a super specific bug in my code that had to do with the wider Rust ecosystems libraries, it really blew me away with that one, but the above was easier to document. You wanted specific though, so there ya go :).

And of course ChatGPT4 is leagues ahead of ChatGPT3.5, so if you're not getting good results you really want to pay for the better model.


This example seems to fall into the same shallow-knowledge or unfamiliarity with the domain which has been the conclusion of everyone that has tried to use chatgpt in their workflow.

If I'm doing something using a language/tool I'm not familiar with then chatgpt is useful because it is better than searching the docs since a lot of documentation is usually a wall of text with no usage examples.

Other than that, all the examples people provide regarding how much of a 'game-changer' chatgpt is always fall into the same google/stackoverflow use case at best or the vague planning/designing/unit-test which tells nothing at all.


That I can know almost nothing about VimScript and Hljs, yet be productive in both, is the game changer! It immediately makes me more ambitious and confident in my personal projects, because I know that at least, I can "fake it".

In a lot of cases (like my given example) the faking it is all I need. The only thing I needed to know about that JS syntax highlighting library was how to import it, the LLM handled the rest.

It saved me a ton of time! I don't think anyone is claiming that ChatGPT is going to immediately replace programmers anymore, but it is increasing the speed at which I can grind through problems I don't have deep knowledge in.

I wonder if these disagreements in ChatGPT's usefulness come down to peoples programming domains. I can see how if you're very knowledgeable and productive in a particular space, like say embedded C programming, and that's the only code you ever write, then ChatGPT doesn't have a lot to offer, because you already know everything you need to know to be effective.

ChatGPT's nice for exploratory programming, it makes me a more creative person, in the literal sense that I'm creating more stuff now then I ever have.


None of this is about writing software? Sure, these things are useful for building products, marketing, etc. but none of it is technical - how am I going to write better software with ChatGPT? Believe me, I've tried, and it's not that good!


Unfortunately for this poor foolish man, he has spiked his own credibility with his zeal for AI. I mean, aren’t you kind of dismissing this post as “oh it was probably written by ChatGPT.”

One indicator of low credibility is that he keeps saying “this saved me weeks of work” for things that look like they might take a few minutes to do with a spreadsheet, or else could be Googled, or for which there are already free tools, or frankly don’t even need to be done.

I have a bias about his project that I will admit: he seems to be yet another one of those smug entrepreneurs who’s goal in life is to contribute nothing creatively or intellectually to the world. A parasite. Fills me with loathing.


> If you routinely pass in a dataset to AI, it can identify anomalies and watch to see if it settles or even reason why the anomaly occurred in the first place. You can provide the AI some guidelines to only alert when something needs attention if it meets a certain set of criteria. This ultimately increases the effectiveness of your on-call crew and lowers your TCO purely based on manpower.

> ...

> So you could use ChatGPT to identify activity trends of an individual to get a statistically high likelihood of reaching them online. Imagine this audit history

> [dataset of login and logout timestamps] `Return a json object with a "sendAtTime" property in ISO-8601 format that has the highest likelihood of reaching the person the next time they are online.`

This feels like it is slightly conflating the strengths of LLMs and AI as a whole.

There are certainly machine learning models that would assist in predicting when a user will be next online, and using an AI assistant to assist in writing such an implementation would likely be helpful.

However, passing JSON into an LLM, asking it to emulate a program to perform this functionality, and then parsing the response to extract other JSON doesn't feel like a stable approach (for example: I was unable to recreate their successful execution under ChatGPT v3), especially given this technique, if widely adopted, may end up including user-controlled fields that would make the system vulnerable to prompt injection.


I'm one of those annoying people who won't shut up about NixOS and thinks the LLMs are a bit of a fad, but chatGPT4 blew me away recently when debugging build issues with Nix derivations.

Whatever combination of the nixlanguage being obscure but also concise, but also, one of the largest github repos seems to have left ChatGPT with a fantastic understanding of the language.

Often you can just paste the error message in unprompted and it will guide you on your way, suggesting missing package names or bad assumptions.

* https://chat.openai.com/share/3b554aa0-5f1b-49e2-bce7-cfe60b...

* https://chat.openai.com/share/dfd30c49-505f-4b95-b6cb-759b7f...

* https://chat.openai.com/share/55dfcbed-2f9d-457f-b1ca-5486fe...


It can generate example data for tests but why would I want that when, if I use a good property testing framework, I already have that; and it can shrink examples sensibly so that I get the minimal failing example for my test?

Generating code seems worse too. I agree that you don’t need “perfect,” software if you’re building a blog for your local soccer team. Maybe you want more precaution if you’re initiating trades in securities. And definitely a lot more scrutiny if you’re building real-time control systems for helicopters. Verifying that code is correct with regards to its specification first requires a precise, formal specification; and second, is still a lot of work.

Eyeballing every line of code to catch errors ChatGPT introduces into your code isn’t going to work. You’re not a compiler or theorem prover and you’re bad at finding errors in code. Really bad. It’s not your fault; code becomes incredibly complex quickly.

At best, right now, it’s a curious toy and maybe useful for some folks as a “smart” autocomplete. But beyond that ChatGPT seems to struggle. And I struggle to find a use for it myself.


The comment about asking ChatGPT for the content (in this case an alternative to a workout database) is interesting. They supposedly saved "weeks" not building up the domain knowledge necessary to build up proper workout plans. ...but without doing that work, how do they know the AI content is any good?


They don't.

And when you're an expert in an area, you find ChatGPT presents folk opinion rather than expert opinion.

It's very much a journalist of the internet


I don't think building applications around it is a good idea. You might face the same problems Reddit developers are facing right now with Reddit's API.

What happens if OpenAI decides to increase the price on you? Now you are losing massive amounts of money and have no where to go.

What if OpenAI decides they don't like how your company is operating and bans you from using OpenAI APIs. Where do you go?

What happens if OpenAI changes their model over night and now you are getting bad responses from your prompt. What do you do?

What happens if OpenAI's API goes down?

Unlike most services you use to build application there is no alternatives to OpenAI's API. You can't simply switch to another LLM API and expect the same results.


Well there are interesting alternatives today. I find Claude (https://www.anthropic.com/) and Dolphin / ChatDolphin (https://nlpcloud.com) to be very good alternatives to ChatGPT.


The author seems really happy about his "random muscle group into chatgpt into workout plan for the day" automation but having exercised for 12 years it seems incredibly naive to me.

I mean sure, if it keeps things fresh and keeps you moving it's better than nothing but that's not a good structure if you want to progress past a year of training or do anything serious.

Literally just doing a random program like the reddit recommended BWF routine is vastly superior and doesn't require chatgpt or serverless or anything..


I have found ChatGPT to give bad answers for more complicated questions. For example, the other day I encountered some TypeScript code that surprised me. Basically it was:

class A { @SomeDecorator() x: string }

const value: A = {x: "foo"};

I was surprised that it compiled at all and structural typing applied to classes, even though '!(value instanceof A)'. But it worked! I asked ChatGPT for more information about this, and basically it just told me that it wouldn't compile, which was obviously wrong.


It’s not a bad article. Only feedback I would have is about this passage:

“”” If you routinely pass in a dataset to AI, it can identify anomalies and watch to see if it settles or even reason why the anomaly occurred in the first place. “””

This is not a great use for LLM’s. AI? Sure. But not this type of it.


i use gpt4 daily.

it’s not very good at writing code, but can write code in small well defined chunks.

i’m working on a game with blender, cpp, physx, and wickedengine.

it writes a lot of python for blender with prompts like:

blender. python. apply transforms to every object unless X.

these tend to work, if scoped small enough, and any exceptions or failures are put as followup prompts.

writing python for blender is more annoying than hard, so this is great.

the other type of prompt i use a lot is like this:

blender. did X. expected Y. got Z. why?

i use prompts like these a lot, for cpp, physx, and wickedengine. often i ask for code, but not to copy it verbatim, but because i’m thinking in code.

these types of prompts usually output a list of possibilities. almost always the list contains what i’m looking for. usually it’s the first item.

a gamedev prompt might be:

wickedengine. code. how to rotate normal 90 degrees right on y in world?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: