3 ms·
Its helpful to do boilerplate in languages or legacy code you touch less often, e.g. React class components. But also, it can reasonably set types for the inpu
by james-revisoai 3y ago
Its helpful to do boilerplate in languages or legacy code you touch less often, e.g. React class components.
But also, it can reasonably set types for the inputs of say a React component, just based on an example (made up) usage of some props you give it. And you can even, if you are very uncouth, simply generate the sensible props for a certain kind of object given a description by say the user.
It can do things like generate controlled form state management etc, which was quite error-prone to do with macros when things get complicated.
It can summarize commits for documented code accurately too, especially if you comment what you've done for some reason or another. This saves a good 2-3 minutes an hour I didn't know I could save, for the average of say 1-2 commits I'd do usually per hour.
Notably GPT-4 is needed to do these consistently well.
- jwestbury 3y agoI mentioned this elsewhere yesterday, but I've used it to do things like stub out an API -- I tell it what I'm making, what endpoints I think I need, and ask if there's anything obvious I'm missing. Sometimes it gives me some ideas for additional endpoints. Then it implements stubs for every endpoints and all the associated code and I'm ready to start adding actual logic. There are sometimes tools available for this, but the nice thing about ChatGPT is that it's effectively a single tool that can be used for any reasonably well-known API framework in any language.
- pylua 3y agoStubbing out endpoints is not usually a task that takes a long time and usually the code is auto generated from a mechanism like openapi. I could see it generating out an openapi file but there are already so many templates out there to start from it does not make sense to use ai for this, in my opinion.