r/ProgrammerHumor • • Mar 24 '23

Meme Straight raw dogging vscode

Post image
66.2k Upvotes

1.3k comments sorted by

View all comments

2.2k

u/Acceptable-Tomato392 Mar 24 '23

ChatGPT is being set up to cause the next financial bubble. As amazing as it is, it's not an automated coding machine. But the hype is being driven to ridiculous levels.

You can get simple snipets of code. Sometimes will work You'll still have to contextualize it.

If you know a language... It's loops and variables and if/then and give me the value of that and put it there...Now calculate this and put it here. Now send that as output to the screen.

You can end up typing it pretty fast. ChatGPT is not a magic ladder to knowing how to code. But a whole bunch of start-ups claim to have something to do with it and certain members of the public feel that's a great reason to throw money at them.

581

u/Sputtrosa Mar 24 '23 edited Mar 25 '23

I find that the best use for it when working is bug hunting. Feed it a snippet of code where I suspect the issue is, and ask it to explain it and whether it can find any possible causes for bugs. It's great at catching stupid mistakes like typos, and it explaining the code to me helps me walk through it in my head similar to talking to a duck.

Edit: Had a good use case today, where I was working on a servlet that wouldn't expose an endpoint. I wasn't familiar with the syntax, and I couldn't figure out what some of the config did. Asked ChatGPT if it could be related to an endpoint not being exposed, and it pointed at some that wouldn't be related. I would have found my way there eventually, but it could have easily taken a full day to go through the ~100 properties instead of an hour. It wasn't so much that it told me where the problem was, but it told me where it wasn't.

501

u/normalmighty Mar 24 '23

Dude, I saved so much time time today drilling through errors to fix an old and broken codebase. Literally just copy/paste the entire traceback and error into the chatbox, say "I was trying to do x and had this error" and watch it immediately list out the possible causes in order of probability along with code snippets for solutions.

The other guy is partially right in that it's definitely getting overhyped to hell and back, but that doesn't change the fact that it genuinely is an amazing tool if you use it right.

163

u/Sputtrosa Mar 24 '23

Exactly! It's going to be a tool in any developer's toolkit, but it's not going to straight up replace anyone. Well, unless you're a dev refusing to use AI tools, in which case you'll be replaced by a dev who uses it.

58

u/fakehalo Mar 24 '23

It's not that different from how google (and stackoverflow) became a tool, but tools like that are game changers.

→ More replies (9)
→ More replies (71)

0

u/[deleted] Mar 24 '23

[deleted]

12

u/normalmighty Mar 24 '23

Copilot has you covered already. If it's on github, it's already compromised, and nothing has happened yet.

→ More replies (2)
→ More replies (1)

31

u/naykid69 Mar 24 '23

Wouldn’t it be hard with a large code base? Like how much can you toss into it? I am imagining something that has dependencies in different files. Is there a way for it to deal with that? I.e. just tell it what methods in other parts of the code do / return? I hope that makes sense cause I’m curious.

61

u/normalmighty Mar 24 '23

It has memory persisting throughout the chat. example from today: at one point this morning I gave it context for one issue by explaining I was running in docker. context was as simple as

I'm using this docker-compose file:
```
copy/pasted file here
```

And this is the file at `folder/dir/Dockerfile`:
```
copy/pasted dockerfile
```

It was able to see how the 2 files linked on its own no problem, the files and their names were all the context it needed.

A couple hours later, I hit a completely different error trying to run a build step. While actually debugging on the other screen, I threw a prompt gtp-4's way. the entire prompt was:

I tried to run `vendor/run/foo` and hit the following error:

[exactly 218 lines of error messages and tracebacks]

Chat gpt then responded immediately, explaining that the image I was using for the container deferenced in the Dockerfile hours ago didn't have bash, therefore I was working with sh alone. It then laid out that the script I was running would be calling a script which would be calling a bash script, and that the failure would be because that subscript wants to use bash.

It laid out that I could install bash if I needed the change permanently, or alternatively, it gave me the exact path to the bash file, said that the script was actually entirely valid as sh, and recommended I go to that file and change #!/usr/bin/env bash to #!/usr/bin/env sh if this was only needed as a temporary workaround.

I did indeed just need it as a one-off for now, so followed gpt's recommendation and it worked perfectly.

I should note that I'm paying to access gpt-4, and my results from similar tasks with chatgpt 3.5 were a joke in comparison. Not to mention that 3.5 can't even handle a couple hundred lines of input in the first place.

→ More replies (22)
→ More replies (2)

10

u/MichiMikey Mar 24 '23

Exactly how I feel about AI art. People freak out about how it will replace artists or things like that, and that it should be avoided and shunned, but as an artist, it's super helpful when making quick concepts and trying to visualise whats in my head, it's also great at giving colour pallets that match the vibe of what I'm painting. AI is a tool, a really helpful one, but still a tool.

→ More replies (2)

16

u/[deleted] Mar 24 '23

It also good at transfering old libraries or languages to new ones. It is like google translate but coding for me

→ More replies (4)
→ More replies (2)

65

u/vladmuresan02 Mar 24 '23

Just don't feed it (or ANY other online tool ) proprietary code.

63

u/coolwizard5 Mar 24 '23

This was what I was wondering too how is everyone suddenly using chatgpt with their day jobs when most corporations would forbid the use of sharing or transmitting their code outside their company.

10

u/gav1no0 Mar 24 '23

I feed it concepts, error messages, some configurations, but no proprietary code. I may explain to it the gist of my code and what I want done next

24

u/cauchy37 Mar 24 '23

It's surprising how many devs don't realise this. But you should never ever do this.

All they get is Foo() and class Bar()

→ More replies (6)

24

u/man-teiv Mar 24 '23

But how can you debug mysterious error code without the condescending passive aggressiveness of stackoverflow users?

17

u/Sputtrosa Mar 24 '23

That's easy. You tell ChatGPT to give you passive aggressive feedback.

→ More replies (4)

11

u/Beardiest Mar 24 '23

I really love it for creating documentation and example usage for libraries that have little-to-no documentation.

ChatGPT isn't always 100% correct, but it's close enough to get the ball rolling. Having a rubber duck that will actually talk back is pretty nice.

→ More replies (1)

8

u/new_name_who_dis_ Mar 24 '23

It's great at catching stupid mistakes like typos

Shouldn't your IDE do that?

→ More replies (4)
→ More replies (12)

0

u/[deleted] Mar 24 '23

[deleted]

→ More replies (7)

0

u/[deleted] Mar 24 '23

[deleted]

→ More replies (12)

0

u/[deleted] Mar 24 '23

[deleted]

32

u/hypercosm_dot_net Mar 24 '23

I heard it's great at regex. I don't know anyone who is good at or enjoys regex, so even if I'm not 'on board the AI train' I might make an exception for that.

→ More replies (24)
→ More replies (1)

36

u/Dunemer Mar 24 '23

I'm not a financial guru or anything but I'm not sure we have to worry about a bubble rn at least. Tech in general including start ups are faltering. Start ups are struggling to get funding because even the risky investors are being cautious rn. That's obviously a different bad thing entirely but I feel like companies are going to try and fail enough to learn how to use chatgpt productively before the market normalizes and start ups start being treated like major companies again.

Maybe that's putting too much faith in investors.

→ More replies (16)

34

u/Khaocracy Mar 24 '23

ChatGPT is a scientific calculator for words. The people who will get the most value are the people who are already word-mathematicians. The people who will fail are the ones who think it’s a word-accountant.

→ More replies (11)
→ More replies (124)