News for hackers. Stuff that matters.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by yosito on Monday March 27, 2023 @12:57PM (#35329106)
I've got a thread going with ChatGPT about an app I'm building. It knows all of the libraries I'm using, and has seen the main App component, the Router and many of the key components. I'm asking it about every task I need to do, feature I need to implement, bug I need to fix. Basically rubber ducking with it and talking through everything I'm doing as if it were my coworker. It's reducing my time to solve problems by about 80%. I'm able to do 4-6 times as much in a day as I could without ChatGPT when I was stuck figuring out everything tediously on my own. For context, I'm a full stack developer with about 15 years of experience, so I know what I'm doing. ChatGPT is just taking care of a lot of the trial and error and figuring out how to use different libraries or implement certain algorithms.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by ryangs on Monday March 27, 2023 @01:20PM (#35329449)
Can you describe the structure of your conversation? Did you describe what libraries you were using and send the full code of the main app component?
Re:Ask HN: What is a specific use of GPT-4 that you think is... by yosito on Monday March 27, 2023 @01:31PM (#35329621)
I started with a pretty simple prompt: "I am building an app using Expo, React Native, React Navigation, React Query, Nativebase, Google Maps and lodash. Expo exports the app for web, iOS and Android. The purpose of the app is to view data related to <specific domain> on a map. The data comes from an internal API."

And then just started asking it questions about each task I was trying to complete. Often I say, "Here is my code in MyComponent.jsx: <paste code> I want to implement <describe feature>. How can I do that?" and GPT will usually respond with tutorial-like steps to take, or sometimes just with the code for a function it thinks I should implement. I read what it suggests, paste it, modify it if necessary, try it out, adjust and repeat.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by achenatx on Tuesday March 28, 2023 @02:08PM (#35345338)
here is one I used for teaching girl scouts to code:

chat gpt build me a pong program using Ruby2D. It built one but it had some problems

The ball goes through the paddle, please fix that. Then it wrote a collision detection routine for the paddle.

The game has no way to restart. Write code that restarts the game with the space bar. It then did that

Have the game keep score and have the game end at 11 points.

etc

For marketing I did something like

tell me the top problems that CIOs of companies that lease equipment run into with their leasing automation software.

It gave me a relatively generic list.

Which ones of these do CIOs report is the most important.

Integrations

Can you elaborate on the top software that that leasing automation software needs to integrate with. It gave specific software.

etc

Re:Ask HN: What is a specific use of GPT-4 that you think is... by cjdoc29 on Monday March 27, 2023 @01:19PM (#35329427)
So I have yet to use ChatGPT (I know, I know), but are you able to keep long running threads with it? How does it know context about your app? Are you simply copying and pasting code?

This is really cool to hear about.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by throwawaytemp29 on Monday March 27, 2023 @01:39PM (#35329737)
You can run into issues with long running threads. It only has so much context (I think around 4K words). It doesn’t have all the context of all the thread. My understanding is that it is summarizing the thread and resubmitting it as part of the prompt each time.

It took me a while to figure out why it kept forgetting things from earlier in the thread.

I’m looking forward to when you can have a bigger context or explicitly set some sort of context that is persistent.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by satvikpendem on Monday March 27, 2023 @09:07PM (#35334454)
32k words with GPT-4, no? That's what they said in the demo video.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by Yiin on Tuesday March 28, 2023 @07:48PM (#35349809)
only with api and only if you're invited to one.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by Hedepig on Wednesday March 29, 2023 @02:17AM (#35353318)
32k _tokens_. There are approx. 3/4 tokens per word, so that's around 24k words
Re:Ask HN: What is a specific use of GPT-4 that you think is... by yosito on Tuesday March 28, 2023 @12:05AM (#35335789)
Oh, that's interesting. I hadn't noticed it forgetting context, but I just asked "Do you remember the original prompt I gave you when starting this conversation?" and it said "Yes, the original prompt you gave me was: 'Hello, can you help me convert 0.05 BTC to USD?'". So, yeah, it's definitely forgetting some things.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by Hedepig on Wednesday March 29, 2023 @02:20AM (#35353332)
> think around 4K words

4k _tokens_, 1 token is approx. 3/4 a word. So it's roughly 3k words

Re:Ask HN: What is a specific use of GPT-4 that you think is... by yosito on Monday March 27, 2023 @01:27PM (#35329559)
Yep, the threads are permanent. I've got approximately 200 separate threads going with it right now.

I gave it a summary when I started using it: "I am building an app using Expo, React Native, React Navigation, React Query, Nativebase, Google Maps and lodash. Expo exports the app for web, iOS and Android. The purpose of the app is to view data related to <specific domain> on a map. The data comes from an internal API."

Then I started copying and pasting code or asking questions about using the libraries I had mentioned.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by Arnehuang on Monday March 27, 2023 @01:41PM (#35329786)
Wow thats incredible. How are you managing the 200 threads - are you using the api for that? Or just using their chat interface on chat.openai.com and scrolling to the relevant one to continue the converstaion
Re:Ask HN: What is a specific use of GPT-4 that you think is... by jacknews on Monday March 27, 2023 @01:43PM (#35329801)
Would love to read a blog post showing this in detail.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by waboremo on Monday March 27, 2023 @01:44PM (#35329823)
I'm seeing similar, chatgpt replacing a lot of external libraries and digging through the weeds to find the right endpoint.

After all, why bother dealing with so many external libraries to get it done when you can just relay the core ones you must use and ask chatgpt to flesh out the rest in a way that suits your needs? Need a component to be gamepad accessible written in Vue? Ask and you'll receive. No more bothering with that library that hasn't been updated in years or wasting time figuring out if x package is stable enough.

Same with endpoints, no having to sort through 30 different sites and navigating horrible menus to potentially see a comment where someone says "oh the endpoint changed it's actually x". Even if chatgpt gets it wrong, it's so much faster to just tell it that the endpoint is wrong or whatever the error you're actually getting.

Like you mentioned though the big caveat is to know what you're working with. Without that you're going to waste a lot of time not knowing where chatgpt is going wrong. That will probably improve eventually, but if you're trying to learn a new programming language through it, you will likely be holding yourself back or learning very odd patterns.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by gtirloni on Monday March 27, 2023 @03:21PM (#35331108)
If you're not using external libraries that are maintained by other people, how do you handle your code's maintainability in the long-term? Keep asking ChatGPT to fix it when things break?
Re:Ask HN: What is a specific use of GPT-4 that you think is... by waboremo on Monday March 27, 2023 @04:14PM (#35331805)
I want to make something clear, which is that there isn't a total avoidance of external libraries. Only that you're not so quickly choosing them for every problem. It makes sense to use Vue (just an example), it doesn't make sense to use a library that's a wrapper on top of another wrapper to use within Vue. That sort of deal.

You maintain the code the same way those other people maintain their code, testing. They aren't doing anything special here, you still have to write tests (well, you can get GPT to write some of them for you). The upside here is you are the one in control of this and you can change and test to your specific needs. You are not relying on external library who has to appeal to a general huge variety of use cases. You also don't have to deal with a lot of external time-wasters, as you're only working internally so you aren't at the whims of whether or not that group can even work on implementing your change. Plus, no more random changes that catch you by surprise when you're reading the change log.

>Keep asking ChatGPT to fix it when things break?

Hah, maybe some day we will get to that point. Until then we still need to know what is happening, however, you might be surprised to find out how infrequently things require that much input seeing as you aren't at the whims of random other parties constantly.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by sacnoradhq on Monday March 27, 2023 @05:38PM (#35333026)
When this is possible, most human coders will be out of work.

I suggest code obfuscation and other acts of tribal knowledge hoarding for job security. ;)

Re:Ask HN: What is a specific use of GPT-4 that you think is... by valdiorn on Wednesday March 29, 2023 @03:49AM (#35353934)
Usually things break because you used an external library.

A self contained bundle of software with no external dependencies cannot break, because it has no externally changing parts, that should be obvious.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by sacnoradhq on Monday March 27, 2023 @05:36PM (#35333009)
ChatGPT replaces StackOverflow
Re:Ask HN: What is a specific use of GPT-4 that you think is... by satvikpendem on Monday March 27, 2023 @09:06PM (#35334447)
Indeed, but it's sad because ChatGPT won't be indexed like SO, so in the future, we won't really get the same sorts of improvements as we have now.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by fragsworth on Tuesday March 28, 2023 @02:14AM (#35336623)
Hopefully that far in the future, it will actually understand coding on a deep enough level that we won't need to train it anymore.
Re:Ask HN: What is a specific use of GPT-4 that you think is... by notJim on Monday March 27, 2023 @05:17PM (#35332777)
I have a similar-ish thread going for an app I'm building.

In my case, the app is just a toy simulation that simulates creatures with simple neural network brains. I knew very little about neural networks going into it, but knew a few terms to ask ChatGPT about. I initially asked ChatGPT to help me figure out which configuration to use for the neural networks, and to explain what some of the terms mean. I also asked it to provide some code samples and give advice for using some of the libraries involved.

The difference compared to Googling things is that ChatGPT can give you succinct answers to your specific questions. With Google, I'd say half the time Google just ignores half your search terms, or if it decides your search is worthy, the answer to your question is buried somewhere in a long, technical article. ChatGPT will respond to your specific question, and then you can ask follow-up questions.

I do worry about ChatGPT's famous propensity for lying, but I guess it's a bit like getting information from Wikipedia. If something is really important, you better find a better source, but if you're okay with muddling through and taking your learnings with a grain of salt, it's probably fine.

Re:Ask HN: What is a specific use of GPT-4 that you think is... by Terretta on Wednesday March 29, 2023 @08:11AM (#35356014)
The catch with this is when there's been a fundamental shift in best practice within the past year or two.

For example, anything with MacOS predates Ventura, so it will think the Mac is on Python 2 and has no awareness of a host of new APIs/SDKs for hardening.

On the other hand, if you're doing it regularly, you are also learning how to frame your interaction to keep it on point rather than hallucinating positivity. Once you hit that stride, it's indeed a handy little rubber duck!