I Asked GPT-4 To Refactor My Legacy Codebase

I Asked GPT-4 To Refactor My Legacy Codebase

Nick Chapsas

1 год назад

348,693 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@StefanoGabriele1983
@StefanoGabriele1983 - 13.11.2023 01:47

Is there a service where we can give a solution (.net core or framework) and the AI will refactor it for you or help to find bugs or bad practices?

Ответить
@deepfakes4567
@deepfakes4567 - 02.11.2023 12:55

lol

Ответить
@gridlocdev2023
@gridlocdev2023 - 07.10.2023 02:49

This looks impressive, however I worry that with the suspected worsening performance of GPT-4 over time the results may have changed. I'd love to see another follow-up video or a short to see if it's still as good as when this video was posted!

Ответить
@AthelstanEngland
@AthelstanEngland - 01.10.2023 20:43

This code is above my understanding but this is still perhaps one of my favourite videos just cos of your reactions! 😅

Ответить
@gavrihak
@gavrihak - 24.07.2023 13:51

Thanks Nick!
How can I ask gpt4 to refactor all my code and not just the pieces I paste to him? Is there a way to allow him to study my entire repository?

Ответить
@ref_softwaredevelopment5298
@ref_softwaredevelopment5298 - 04.07.2023 15:59

LOL. "Do this to pass the interview". I say those things and interviewers think I'm talking bs that isn't important for just "getting things done" and I'm passed over.

Ответить
@HanniballabinnaH
@HanniballabinnaH - 01.07.2023 19:12

Everybody is worried about their jobs.
All this means is that we can build bigger faster and far more complex.

Ответить
@calculatorcalculator5998
@calculatorcalculator5998 - 03.06.2023 22:00

Hey there! I see you're really enjoying it. But do you think it poses a threat to our jobs as developers?

Ответить
@yhzhao5454
@yhzhao5454 - 30.05.2023 13:24

why your GPT-4 can handle 25k tokens?

Ответить
@silicitimmm
@silicitimmm - 22.05.2023 22:18

what I dislike about this video is the person has gone through this exact process and has copy paste questions, but acts surprised as if its really a surprise. c'mon bro. the audience is not 15 yrs old, this feels cringe. other than that, good video.

Ответить
@jessecalato4677
@jessecalato4677 - 18.05.2023 21:48

If you can't see the legitimacy to the "fear mongering" then I don't know what to tell you. Great video outside of that comment.

Ответить
@lutusp
@lutusp - 11.05.2023 07:15

I realize you may already have thought of this, but a company posing a refactoring problem as an interview requirement might actually be a way for the "employer" to get free programming time from dozens of eager job candidates, after which they might "reluctantly" decide not to hire anyone, since the problem to be solved by the new hire has just been solved. Hey, just saying.

Ответить
@ViktorFerenczi
@ViktorFerenczi - 09.05.2023 00:26

100 messages / 4 hours? Now we get only 25 / 3 hours. How come?

Ответить
@atari1040
@atari1040 - 06.05.2023 23:33

Seriously you are going to paste your customer's code to some "AI" provider? Then for sure you will lose the job without waiting for AI to get smarter :D

Ответить
@MikkoRantalainen
@MikkoRantalainen - 06.05.2023 14:56

I have been working as a software developer for 20 years with the same employer. Are you really telling me that this kind of stuff is considered "senior interview" nowadays? I would have expected this kind of refactoring to be required for non-senior positions already.

Ответить
@_FLOROID_
@_FLOROID_ - 05.05.2023 21:43

If it's an interview question then GPTs responses aren't indicative of real-world performance as it has likely seen this task or similar tasks before in its training dataset.
Often times when I actually try to use it at work it utterly fails across the board. As soon as I could find a simple solution online for a refactoring problem - it gives better answers.

Ответить
@fyrestorme
@fyrestorme - 03.05.2023 17:56

I have used gpt-4 to write code and I would NOT trust it to fix or even identify all bugs

Ответить
@abracadabra6203
@abracadabra6203 - 03.05.2023 09:48

and then you will found a patent for your code. lol

Ответить
@frun
@frun - 24.04.2023 19:22

I never imagined AI will be able to learn to program that good that fast ⏩⏩⏩ 🍾 🤖🍾

Ответить
@andrewlydon7819
@andrewlydon7819 - 17.04.2023 21:31

I'm speechless. I've been programming for 40 years and had absolutely no idea that an AI could be anywhere near this good. This refactoring example was especially amusing for me since I've had trouble convincing some 'senior' colleagues about the need to inject a time dependency.

Ответить
@Bluelagoonstudios
@Bluelagoonstudios - 16.04.2023 17:47

Hi, I'm a n00b in programming like a simple Arduino for audio use, ChatGPT did give great code to develop effects in JS to use with my DAW, what I learned, you have to feed specifics into the script to get good results. Now in the past I coded databases in dBase III and IV for bookkeepers, but I forgot a lot, but I recognize the strings that are used, not in JS specific, but I used it already to code a playlist database in SQL. It's great stuff what it can do. And a good refresher for my memory. Great channel BTW.

Ответить
@RoscaValentin
@RoscaValentin - 13.04.2023 16:36

Does anyone stop to think that inputting your company's proprietary code into ChatGPT is a violation of your work agreement ? That your company's proprietary code might contain trade secrets that you have now made part of the public domain. That ChatGPT will use this input when the next persons asks "How do I make a [insert_company_name] clone".
I mean, I'm all for "Fuck the billionaires and capitalistic empires", but this needs to be conscious decision.
Just because the code is legacy in terms of design patterns or libraries used it doesn't mean that in terms of the problem domain it tackles it doesn't have a novel and ultra performant way of solving a complex problem. You might just give that away.

Ответить
@ltra42
@ltra42 - 11.04.2023 12:59

I've been using ChatGPT for a few days now. Guess what, now every time I said "hello" give gives me an answer in code, like below

ChatGPT
/login
Hello! Welcome back. Please login with username and password.

Me
Are you joking with me?

ChatGPT
No, I'm not joking

Cracks me up every time. One time, it even wrote hello in code and wrote a test case, said something like should contains 'Goodbye'

Ответить
@georgiosdrosinos9530
@georgiosdrosinos9530 - 06.04.2023 11:37

Hey there! It would interesting if you write some tests first, and then let GPT-4 to write the code to pass them.

Ответить
@PeterSteele111
@PeterSteele111 - 05.04.2023 04:56

I use the free ChatGPT to refactor functions and longer functions that need to be split in my code almost daily. It has saved me a lot of time. I have to fix some things, but have learned a few neat tricks from it.

Ответить
@aveekbiswas2176
@aveekbiswas2176 - 05.04.2023 00:29

Can we give multiple files at once or an entire project to ChatGPT to review/refactor? Or is the only way to do that is by copy-pasting code snippets to the ChatGPT console?

Ответить
@ifstatementifstatement2704
@ifstatementifstatement2704 - 03.04.2023 23:24

Many question the very validity of OOP for programming in general. It was invented by a marine biologist who wanted to code a program mimicking marine life.

Ответить
@dohua_ai
@dohua_ai - 03.04.2023 12:39

So i see GPT is amazing tool for dumb seniors and juniors, GPT finally can do what lazy impostors dont like - THINK

Ответить
@jamesyoo67
@jamesyoo67 - 03.04.2023 07:00

Hey Nick, I watched this late. Really important question: do you think this is ready to refactor real production, mission critical (i.e. financial) applications?

Ответить
@RicoNinjaneer
@RicoNinjaneer - 02.04.2023 07:00

this legacy code is trash, we would never release this, i don't see a single design principal

Ответить
@higherbeingX
@higherbeingX - 02.04.2023 00:17

i think i can keep my bartender job for some more time. All the best devs.

Ответить
@derkin860
@derkin860 - 01.04.2023 21:18

I did the same and it was great. Nothing super complicated but it helped me refactor an Azure Function that was long running into a fan out/in durable orchestrator function calling activity functions. I then asked it if the system could handle 10k requests a second just for fun even though obviously that's a heavy load. It gave me a very thorough list of everything I needed to do to ensure the best scalability and performance.. bottlenecks, rate limits, db, parallelism in functions, etc. Developing with GPT-4 is a delight so far. It feels like having a teacher and a coder working for you at the same time.

Ответить
@patrickdahl937
@patrickdahl937 - 01.04.2023 08:57

Love you video, imagine when it can read an entire technical document to gain domain knowledge and translate to code...

Ответить
@phutureproof
@phutureproof - 31.03.2023 22:25

no you didnt, you asked the public facing gpt which is basically a public facing toddler you third world bastard

Ответить
@jordanscott8088
@jordanscott8088 - 31.03.2023 20:11

I tried to get chat gpt 4 to convert a simple positive number into binary it got it wrong.... every single time I tried

Ответить
@hunterzone4846
@hunterzone4846 - 30.03.2023 15:14

You should wrap the code inside a code block, for example:
```
//code
```

Ответить
@rodbenson5879
@rodbenson5879 - 30.03.2023 12:53

And just like that programmers developed an AGI to make themselves redundant.

Ответить
@ihatethesensors
@ihatethesensors - 29.03.2023 03:36

That was great my reaction was about the same.

Ответить
@yuriy5376
@yuriy5376 - 28.03.2023 16:46

This is still pretty basic stuff.
It works pretty good if your give it a very common task which has already been solved thousands of times on Internet forums in slightly different combinations.
But as soon as I've tried to make it solve a non-so-common task with DevExpress library, it very confidently gave me an answer which simply doesn't work, because ChatGPT just made up randow library event which doesn't even exist. It tried 10 times, each time giving me a new made up event, without even a hint of hesitation.

Ответить
@arnoldasllani6545
@arnoldasllani6545 - 27.03.2023 16:47

It will still will need a human to drive it. If you fear you will be replaced then learn how to drive/tune the AI agent and you will still have a job

Ответить
@gbormann71
@gbormann71 - 26.03.2023 13:42

The IClock thing is what you'd expect from a Senior Dev? Can juniors or mediors already talk?

Ответить
@devnami
@devnami - 26.03.2023 07:30

What's your opinion on ChatGPT and it being replacing the devops jobs? Do you think that's a possibility in near future? Is it going to happen?

Ответить
@maxnova9763
@maxnova9763 - 25.03.2023 18:38

How would this pan out if you give it a problem that isn't an interview question?

Ответить
@Daaaaaaavid
@Daaaaaaavid - 25.03.2023 16:02

Programming became too stupid, 1 Million rules and different ways of doing the same thing. Programming itself should evolve into being easier year after year.

Ответить
@ServandoPestano
@ServandoPestano - 25.03.2023 14:40

It is really impressive (all about) this tool. And this is just the beginning...

Ответить
@anirev9745
@anirev9745 - 25.03.2023 10:59

Man, the amount of time that will be saved by adding AI to the workflow is insane not to mention how much time this will save for someone learning programming now. Instead of wasting copious amount of time looking for a stupid bug that is breaking your code and wasting your time, now you have a friend to brainstorm any issue out of existence for you so you can continue your learning/working process productively. Some might think this will lead to bad habits weakening programmers in general as they get dependant on AI. However, this is what happens with new breaking technology all the time. It makes your current troubles that you've been struggling with just a minute ago into a thing of the past so much that now you have nothing to do other than to look ahead to the new horizon, ideas and innovations. Tech has reached a saturation point before AI where any innovation has been minimally incremental. With AI, I can see that totally changing where in the next few years we will witness huge forward leaps and breakthroughs in many fields and I am here for it and cannot wait to be a part of it.

Ответить
@rickhoro
@rickhoro - 25.03.2023 04:27

We're f--ked. Period...end of story.

Ответить