DEV Community

Cover image for How to solve coding issues using ChatGPT

How to solve coding issues using ChatGPT

JS on December 27, 2022

The Issue I need to solve Simply put, I need to check if a node package is installed in runtime. The reason is that I’m building a new t...
Collapse
 
mitch1009 profile image
Mitch Chimwemwe Chanza

Practically speaking, All blogs I have read so far about ChatGPT even the ones from the very people we consider sane in our industry semm to be not factual. Yes chatgpt can do a lot of magic but it needs someone who knows what he/she is doing. Don't expect someone who has never done coding before to become a rocket scientist because of chatgpt. One boring thing I have read over the past two weeks also was the comparison of chatgpt to other ai models like palm which as of now no one has ever used in public. As if that is not insane enough some youtubers are posting things that put fear in developers minds. Take heart guys they will need developers even if an ai system becomes sentient it cannot be human. That's my take.

Collapse
 
ymc9 profile image
ymc9

The promoted fear of ChatGPT can be a useful filter to block people who're not psychologically strong enough to enter this profession ...

Collapse
 
jiasheng profile image
JS

Interesting idea. Sounds like it could improve the overall quality of developers from one more perspective. 😄

Collapse
 
paterne81 profile image
Paterne G. • Edited

Je suis totalement d’accord avec vous. Quelque soit alpha nous, les développeurs ne disparaîtrons pas. Bien vrai que ChatGPT aide énormément il a toujours besoin qu’on lui donne des directives bien définies pour pouvoir nous étaler nos besoins.
La seule question qui me traîne dans l’esprit 🤔 en ce moment : Pourquoi Google serait-il craintif ?
Sur ceux, je vous souhaite une bonne et heureuse année 2023.

Collapse
 
jiasheng profile image
JS • Edited

Because I think there would be more and more cases in that people would directly ask questions for ChatGPT instead of searching in google like what I did in this post. 😄

However, I guess Google would probably provide a similar service in the future as Larry Page said “we are really making AI” before google’s IPO. 😉

Thread Thread
 
paulchase profile image
Paul Ajonye

I heard they have dedicated a team to create something similar 🙂.

And I'm guessing Google tactics would be to make it free forever and start placing Ads later.

Thread Thread
 
jiasheng profile image
JS

😂 That does sounds like Google’s tactics.

Collapse
 
cppshane profile image
Shane Duffy

they will need developers

Sure, but they will need less developers

Collapse
 
giampaolo44 profile image
Giampaolo Ferradini

Mmm... I suspect coding is like health care: the more the available offer, the larger the demand.
Consider how much manual work is still performed, and how much could be automated. It'll take us three generations to fill those requirements, and another two to redo stuff that was poorly done.

Collapse
 
jiasheng profile image
JS

Speaking of YouTubers, I think that’s part of the nature of media, exaggerating to exploding. Here Dev.to is more objectives as it’s really to Dev. 😄

Collapse
 
matthewbdaly profile image
Matthew Daly

I've done enough tinkering with it that I feel reasonably confident talking about what it can and can't do, and I'm confident it's not going to replace me. At this point it's basically not much more than a smarter search engine - it's better than Google at tracking down specific examples of a particular thing, and you can refine those examples progressively to get it closer to what you want, but you still need to understand those examples to be able to implement them. It does make more of the job about composition and editing than about writing code, but you still need to be able to understand what's going on, though.

I would be far more concerned about my job if it was the poorest sort of content creation though. Given how bad those sort of blog posts tend to be, and the fact that ChatGPT is noticeably better at producing them, I would not be surprised if those sort of poor quality blog posts are overwhelmingly written by AI in a year.

Collapse
 
anthonywhitaker profile image
Anthony Whitaker

What I find interesting is that while ChatGPT arguably helped you solve your problem, you still failed to actually learn what was going on. The reason your unhandledError hook didn't fire has nothing to do with prisma potentially having a flag or doing something odd. The solution ChatGPT provided involves handling the module not found exception... therefore by definition your unhandled hook is never going to fire. The whole subprocess hack that you're calling a _Clean Solution _ is completely unnecessary and misleading to others who may unfortunately stumble upon this article.

A better approach to become an adequate developer... always aim to understand a situation, then solve it. Searching for the solution seems like the fast path but in the end you're left with buggy, ineffective code that kinda/sorta sometimes works... all because you don't truly understand what's happening.

It's like going to the doctor saying your leg hurts. The doctor gives you morphine and all the sudden, you feel better! Problem solved!!! Except your leg was broken and you needed a cast. You can't just treat the symptom as a doctor, or a developer.

That said, maybe ask ChatGPT about unhabdled vs handled exceptions and understand how, why, and when the unhandled exception filter would get executed. Best of luck

Collapse
 
jiasheng profile image
JS

Hi Anthony, it seems that l didn’t specify the problem clearly, thanks for pointing it out. I have updated the corresponding content to make it clear.

As you can see I still believe it’s caused by some code of Prisma running when importing the Prisma module because using any other existing module would be fine.

Anyway, I think you are right that I still haven’t truly understand what’s happening under the hood 😂. I think it requires some investigation of the source code of Prisma. I will take a look later and update the result here.

Collapse
 
jiasheng profile image
JS

Updated in the end of the post.

Collapse
 
killianellie1 profile image
Killian Ellie

Yes google should worry about that 🤣
Did you try chatgpt x google search engine. It's developed by me. Try it out and let's me know what you think 😄😄
Try it

Collapse
 
jiasheng profile image
JS • Edited

Nice tool! You are actually threatening Gooogle. 😁

Collapse
 
killianellie1 profile image
Killian Ellie

hahaha

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

It took me 5 days to steer it to making the blender script in needed and during that time it needed a lot of corrections from me, it didn’t know what was correct and modern and wasn’t aware of API changes until I told it. It also looped around a solution quite a few times or flat out misunderstood this visual task… it’s still incredible

Collapse
 
jiasheng profile image
JS

I like your attitude, It’s all about how we can utilize it. 😄

Collapse
 
andrewbaisden profile image
Andrew Baisden

ChatGPT has so much potential I can't wait to see what else it will be capable of doing in 2023.

Collapse
 
jiasheng profile image
JS

me too! 😎

Collapse
 
tschallacka profile image
Tschallacka

I tried te debug a lua app concerning merging two lists, all the code the chat gave seemed logical, but variable names, logic, etc.. was all wrong in a way that led to weird bugs.

It can give hints, but often it will reference constants from an entire different language or app

Use it as a rubber duck, not to generate your code.

Collapse
 
jiasheng profile image
JS

exacly!

Collapse
 
soulfiremage profile image
Richard Griffiths

In other words, careful intelligent use turns it into another developer amplifier rather than a developer replacer.

I like it.

Collapse
 
jiasheng profile image
JS

Nice one, it’s concise and comprehensive!👍

Collapse
 
jiasheng profile image
JS

Exactly. And we need chatGPT to work for us. 😄

Collapse
 
sorydi3 profile image
sorydi3

YouTubers are clickbait hunters.

Collapse
 
jiasheng profile image
JS

I’m aware of this recently, as I see some has to literally put (Not Clickbait) in the title 😂

Collapse
 
eugenman profile image
Eugen

Yes, it's a tool, not a replacement.

Collapse
 
eugenman profile image
Eugen

You order from menu, but have no idea how it was cooked.
You didn't go all the way to solve the problem.

ChatGPT doesn't help you, it harms you. He does your work for you. So maybe hire him instead of a lazy developer?

Collapse
 
elr0berto profile image
elr0berto

Chatgpt + Unknown breakthrough = everyone is doomed. The unknown breakthrough could be anything.. something that makes us think about everything differently.. some new approach... Could happen any day...could take decades..

Collapse
 
monimartin22 profile image
Moni Martin

There is an extension that can assist you in displaying ChatGPT responses alongside the search results from Google, Bing, and DuckDuckGo. Maybe you should try it: https://chrome.google.com/webstore/detail/chatgpt-for-search-engine/feeonheemodpkdckaljcjogdncpiiban/related?hl=en-GB&authuser=0

Collapse
 
j4acks0n profile image
j4acks0n

Doesnt help at all instruction not clear....

 
krzysiekhan profile image
Krzysztof Handzlik

i asked same question and answear was correct

Thread Thread
 
jiasheng profile image
JS • Edited

The answer is probabilistic. I actually have no doubt that AI could answer this kind of definite question correctly as evolving.