I Asked GPT-4 To Refactor My Legacy Codebase

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มี.ค. 2023
  • Check out my courses: dometrain.com
    Become a Patreon and get source code access: / nickchapsas
    Hello everybody I'm Nick and in this video I will try to get the brand new GPT-4 model to refactor a legacy codebase using ChatGPT. The old model always failed the task so let's see if the new version improved on it.
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: bit.ly/ChapsasGitHub
    Follow me on Twitter: bit.ly/ChapsasTwitter
    Connect on LinkedIn: bit.ly/ChapsasLinkedIn
    Keep coding merch: keepcoding.shop
    #openai #gpt4 #chatgpt

ความคิดเห็น • 477

  • @dmitryborovych9135
    @dmitryborovych9135 ปีที่แล้ว +736

    2023: Nick asking ChatGPT-N to refactor the legacy code
    2027: ChatGPT-N asking Nick to refactor the legacy code to offload servers

    • @xmesaj2
      @xmesaj2 ปีที่แล้ว +82

      2028: ChatGPT-N asking ChatGPT-N to refactor ChatGPT-N

    • @f220696
      @f220696 ปีที่แล้ว +105

      2030: ChatGPT-N "Hello everybody I'm ChatGPT-N and in this video i wil..."

    • @almadesperado
      @almadesperado ปีที่แล้ว +7

      2027 => "2024: ChatGPT-N asking Nick to refactor the legacy code to offload servers"

    • @theyspeakagain
      @theyspeakagain ปีที่แล้ว +36

      2040: ChatGPT refactors Nick's genetic code

    • @sherryssj5
      @sherryssj5 ปีที่แล้ว +7

      2042: ChatGPT-N refactors Nick to Nick-N and they get into an endless loop of Nick-N asking ChatGPT-N+1 to refactor code, it does, then refactors Nick-N to Nick-N+1. However Nick-N+1 will be tasked to find and decommission Nick-N who will have changed his appearance and have gone into hiding.
      Sounds like the plot for a sci fi movie. Maybe something named Bladerunner 2042?

  • @neilhatly
    @neilhatly ปีที่แล้ว +301

    Shows that, just like search engine skills, you still need to know what you want, and how to review good code.

    • @lemmack
      @lemmack ปีที่แล้ว +57

      For now.

    • @Nnm26
      @Nnm26 ปีที่แล้ว +12

      @@lemmack well said

    • @ytchannel6569
      @ytchannel6569 ปีที่แล้ว

      @@lemmack For now for us.

    • @alansmithee419
      @alansmithee419 ปีที่แล้ว +34

      Yes, but it is still much faster than a person could perform the task.
      Replacement is not simply about "it can do your entire job now."
      Replacement also occurs when a tool can be used by someone to produce much more work output than previously.
      If one person can use this tool to produce what used to take five people, guess what? 80% of the work force for that project just got "replaced."
      Yes, high skilled professionals are still needed in this instance to guide and monitor the AI, but many fewer of them than previously.

    • @joelv4495
      @joelv4495 ปีที่แล้ว +17

      @@alansmithee419 It's funny though. For the last 40 some-odd years, we developers have become so highly-valued BECAUSE we are a force for automating away others' jobs. Now the shoe is on the other foot... 😬

  • @Baekstrom
    @Baekstrom ปีที่แล้ว +457

    Cool. My boss can now do the coding for our entire team. I guess I can maybe still get a job sweeping streets and painting fences, until Boston Dynamics rolls out their army of mechanical handymen.

    • @pneumonoultramicroscopicsi4065
      @pneumonoultramicroscopicsi4065 ปีที่แล้ว +15

      Your comment killed me lol

    • @badpuppy3
      @badpuppy3 ปีที่แล้ว +15

      Are you not finding the future to be as great as we were promised??

    • @kingblade1419
      @kingblade1419 ปีที่แล้ว +12

      They say, you will own nothing and you will be happy, Matrix? 🤔

    • @wasabinator
      @wasabinator ปีที่แล้ว +16

      Well your boss will also be an AI so maybe they will be helping you sweep

    • @anderj235
      @anderj235 ปีที่แล้ว +2

      @Tim Laursen, Tesla will beat Boston Dynamics to mass production of a mechanical handyman.

  • @eclipxs6340
    @eclipxs6340 ปีที่แล้ว +139

    I copied the transcript into chat gpt 4 and had it summarize the video:
    "In this video, Nick uses the new GPT-4 model to refactor a legacy codebase in C#. The AI model successfully refactors the code based on the given principles, such as SOLID, KISS, YAGNI, and DRY. It generates an interface, a user repository, and a validator, among other changes. The AI also helps address issues with the constructor and suggests using an IClock interface for dependency injection. The refactored code compiles successfully in the IDE. This demonstrates the potential for AI tools like GPT-4 to assist developers in refactoring legacy codebases and improving overall code quality." - chat gpt 4

    • @me-low-key
      @me-low-key ปีที่แล้ว +30

      This sounds like the Obama medal meme

    • @eaudesolero5631
      @eaudesolero5631 ปีที่แล้ว +10

      It is interesting that it does not note that it itself provided answers that needed revision

    • @TheOnlyGhxst
      @TheOnlyGhxst ปีที่แล้ว

      @@eaudesolero5631 thats because ChatGPT is never wrong, just ask ChatGPT.

  • @andrewlydon7819
    @andrewlydon7819 ปีที่แล้ว +10

    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.

  • @MrStevg8
    @MrStevg8 ปีที่แล้ว +149

    Sooooo impressive and terrifying at the same time. Its growth rate is insane, can't even imagine what it will be like 1 or 2 years down the road.

    • @zolniu
      @zolniu ปีที่แล้ว +43

      From what I know about language models they tend to get better guickly at the begining. But then there is a cut-off point when providing it with more and more data to learn doesn't really improve the model much.

    • @MrBoBrilO
      @MrBoBrilO ปีที่แล้ว +7

      @@zolniu yeah they basically stop "learning" at some point, you can make them work quicker but that's basically it.

    • @MarkCastle
      @MarkCastle ปีที่แล้ว

      Until you let it lose with money and access to cloud compute resources so that it can improve itself by which time it’s acquired the preference to acquire power as it realises that’s a vector to improvement. Sounds nuts? Read the footnote on page 53 and section 2.9 in the gpt 4 white paper openai released. Not even fiction anymore !

    • @asedtf
      @asedtf ปีที่แล้ว +14

      What a time to be alive!

    • @Linkario86
      @Linkario86 ปีที่แล้ว +9

      @@zolniu Yeah the curve is log(n). Plus there is the thing that it can't think for itself. And we're a long shot from that one. It can maybe act like it's thinking by itself but it's not actually doing it.
      Edit: for the emotional and easily butthurt people: the following is a very simplyfied example for the sake of explaining how AIs do not understand things, while they have deductive reasoning, and can draw the conclusion of the following example.
      I mean what this is a huge data storage that basically memorized the internet. It can tell you what 2+2 is. It can tell you why 2+2=4. But it doesn't understand it. Like a Person who just memorized that 2+2=4 because 1+1=2 and 1+1+1+1=4. For the lack of a better and still easy to understand example: If it never learned what 2*2 is, it wouldn't know the answer is 4. Even though it memorized that 1+1=2 but can't get to the solution by just doing that calculation again and put it together => 2*2. A human is capable of that, AI is not. An AGI might be. But then again, fair to say, humans aren't able to memorized the entire internet.

  • @okerror1451
    @okerror1451 ปีที่แล้ว +200

    you're so polite to the AI

    • @nickchapsas
      @nickchapsas  ปีที่แล้ว +438

      It might be my future overlord so I have to play the long game

    • @agsystems8220
      @agsystems8220 ปีที่แล้ว +26

      The AI is trained on real conversations, so the tone of your questions will actually make a difference. If you start talking in a condescending way to it it will be more likely to refer back to conversations that descended into arguments, and less likely to think about when people actually responded productively.

    • @user-tz8ij8ht9b
      @user-tz8ij8ht9b ปีที่แล้ว

      😂

    • @henningtorsteinsen2169
      @henningtorsteinsen2169 ปีที่แล้ว +6

      That way you treat those with less power than yourself says a lot about your character.

    • @alexandruchirita5780
      @alexandruchirita5780 ปีที่แล้ว +6

      ​@@nickchapsas Maybe your long game will fail after he reads your comment. He knew your subscribers at one point in time. Beware and delete as fast as you can 😂

  • @EPK_AI_DUBS
    @EPK_AI_DUBS ปีที่แล้ว +84

    Please keep doing these type of prompt engineering videos with GPT-4, I really enjoy them! Great work

  • @thygrrr
    @thygrrr ปีที่แล้ว +4

    I learned a lot about refactoring today, and I've been a coding for 30+ years. Something is amazing about this video, and it's not just ChatGPT.

  • @Horesmi
    @Horesmi ปีที่แล้ว +4

    -You can youse Google on this interview, you know?
    -Ok, can I use GPT-4 then?
    -Yes of course, that's a great idea!
    Just had this interaction on an interview lmao 😂

  • @sqwert654
    @sqwert654 ปีที่แล้ว +21

    For me making games solo its a boom. Have been coding since the days of the AtariST and this is the first realy useful tool for speeding my workflow I've been excited about.

    • @sqwert654
      @sqwert654 ปีที่แล้ว

      @Transistor Jump no need to finish my 4 player Mahjong UI for flat and VR. Then see how it goes on steam. Only single player atm with AI, but the netcode functions are in but not tested for pc.

    • @RetroDawn
      @RetroDawn ปีที่แล้ว

      Agreed. I'm making new for Atari ST, even. ChatGPT was useless for ASM. I wonder if GPT4 is any better. Likely take some time before a version that can work with legacy CPUs' ASM.

  • @Drumstix42
    @Drumstix42 ปีที่แล้ว

    So cool. This shows that have introductio intrinsic code knowledge is still important, but how awesome it can be to work with a tool to assist. I think the idea that becoming expert code reviewers is the way that these tools will evolve with developers is very true.

  • @Beltalowda55
    @Beltalowda55 ปีที่แล้ว +17

    Wow, this is seriously impressive. I just keep thinking how great it will be to offload most of the grunt work. Remember, this is a "general" chat bot. Future versions coming very soon will be code specific AI toolsets integrated into IDEs and command line utils (CD/CI pipelines, etc.) that can run locally to keep code private and to learn company/domain specific information. This is such a productivity boost. Automatic refactoring, testing, PR reviews, etc... Yes, there will be some "issues" along the way, but I suspect those "issues" will be addressed very quickly. The rate that this progressing is mind blowing. Probably because of the insane productivity of the AI developers that are using their own tools. 😁
    My head is swimming with all of the possibilities. I don't think it will replace devs completely, but there will be much less of us and the job itself will change quite a bit.

    • @Lethcode
      @Lethcode ปีที่แล้ว

      I think there is plenty of work for software teams still but I think you will get by with less people per team.
      Still need security reviews, someone to actually read the code generated and test interactions with other projects.
      For simple programs you won't need a developer. It will be interesting when it starts consuming open api end points and you can tell it to wire up specific calls so you can just build the guts

  • @user-oo7yg8em6e
    @user-oo7yg8em6e ปีที่แล้ว +118

    Hi Nick! See you under the bridge in a couple of years!

    • @nickchapsas
      @nickchapsas  ปีที่แล้ว +76

      Can't wait to start my beekeeping operation

    • @mirekmiedziarek51
      @mirekmiedziarek51 ปีที่แล้ว +12

      @@nickchapsas I'm afraid that beekeping will be handled by AI powered machines anyway :D

    • @niksatan
      @niksatan ปีที่แล้ว +4

      It would not be so bad REFACTORING our jobs. We'll have a big party, hope it's big bridge. I for one say hello to my AI masters-

    • @attribute-4677
      @attribute-4677 ปีที่แล้ว

      😂😭

    • @TheMagenAlex
      @TheMagenAlex ปีที่แล้ว

      see you there, bro

  • @everythingiscoolio
    @everythingiscoolio ปีที่แล้ว +6

    This is what I've been doing, just with more context and feeding it the most recent documentation on whatever I want to use. The expert paradox is real. I have no idea where we're going to go from here.

  • @Bluelagoonstudios
    @Bluelagoonstudios ปีที่แล้ว

    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.

  • @refactorear
    @refactorear ปีที่แล้ว +3

    4:14 Another way to refactor that is to create a seam there, a protected virtual method that internally call the static method, "Extract and Override" and when testing you can create a Testable class which overrides it and does not call anything, logs or validates depending on whether you want a stub, a spy or a mock.
    For those juniors watching this video: note that the initial solution was wrong, the next one too, and that it took some time of back and forth to get with a correct one. Don't just copy without understanding.

  • @seredaom
    @seredaom ปีที่แล้ว +1

    It also does a good job creating unit tests for the code. And can fix mistakes happening in runtime if you feed chatgpt with just exception. At least it did it for me on one of the programs

  • @Scroapy
    @Scroapy ปีที่แล้ว +31

    I like where this is heading and this will be very interesting to see in couple years. I kinda feel bad for junior developers tho, since you have to know almost everything to guide it in the right directions and also to see the flaws, it has in the generated snippets.
    That being said I can already see some disasters that this tool will produce.
    a/ basically sharing your codebase with the engine - breaking most of security protocols in the company
    b/ Dunning-Kruger effect amplified for junior devs - which can cause disasters for the company in the long run, when things start falling apart
    c/ possible worse treatment by other non-dev employees in the company - but if this tool gets good enough, you can easily ditch the company and start your own, since you will be efficient like a team of 10, but without all the communication/management/cost issues.

    • @donelbaron
      @donelbaron ปีที่แล้ว +3

      d/ then your and old company is not needed since there might be a lot of them

    • @Scroapy
      @Scroapy ปีที่แล้ว +1

      d/ aint gonna happen... only for some very specific market segments

    • @cl1489
      @cl1489 ปีที่แล้ว

      This makes it even better for junior developers, lol. They can learn faster. This is a positive, not negative.

    • @KeithOlson
      @KeithOlson ปีที่แล้ว

      a/ In a corporate setting, you would *DEFINITELY* be using this in a clean room setup.
      b/ I would *NEVER* allow this to be used for anything more than a time-saving tool for senior devs. (...though I /could/ see marketing/etc. using it to put what they want into a framework that devs can understand AND ACTUALLY BLODDY IMPLEMENT.)

    • @pneumonoultramicroscopicsi4065
      @pneumonoultramicroscopicsi4065 ปีที่แล้ว

      @@KeithOlson i think coding in general will eventually be replaced by natural language

  • @worldinstyle
    @worldinstyle ปีที่แล้ว +3

    Learned a lot in a few minutes. can u do similar videos of refactoring please with gpt4 and ur added reasoning and explanation.

  • @SomeKindOfMattias
    @SomeKindOfMattias ปีที่แล้ว +4

    The one to seems work best is "refactor according to the guidelines of the book Clean Code" (can tack on SOLID as well). Its really hard to make it really break down everything down into small methods but that one is the most efficient I found. Uncle Bob is the Greg Rutkowski of coding :) . "Write extension methods covering all if-statements" is also a good one

    • @nickchapsas
      @nickchapsas  ปีที่แล้ว +2

      I mean, not only did it break things in small methods but it also extracted into classes

    • @SomeKindOfMattias
      @SomeKindOfMattias ปีที่แล้ว +1

      @@nickchapsas Ask it to make a state machine *BOOM* all business logic in one go :)

  • @ClaytonHunt
    @ClaytonHunt ปีที่แล้ว +5

    This is Awesome, can't wait to unleash it on some of our legacy codebases!

    • @maxpkr
      @maxpkr ปีที่แล้ว +1

      Developers who write code might become legacy

  • @dawid_dahl
    @dawid_dahl ปีที่แล้ว +9

    This is absolutely amazing. I can not believe how mind-blowing this is.
    As a developer (even though TypeScript), I’m really grateful for these videos where you go much more in depth with AI and programming/system design, instead of just having it make simple functions.
    I’m going to hit the bell icon to get all your videos from now on. 🙏🏻

    • @batman313rd
      @batman313rd ปีที่แล้ว +1

      TypeScript does a powerful language. Don't sell yourself short.

    • @yuriy5376
      @yuriy5376 ปีที่แล้ว

      Not that impressive at all once try to get it to solve smth more complicated than a HelloWorld example from the official documentation or do some basic refactoring. Once it's taken off the beaten path, it makes so many mistakes and simply invents APIs that don't exist only for you to find out that the code doesn't even compile.

  • @derkin860
    @derkin860 ปีที่แล้ว

    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.

  • @andriisnihyr6497
    @andriisnihyr6497 ปีที่แล้ว

    That's pretty cool, I can see it being useful in some scenarios as a co-pilot. Still would love to see how it does with really crappy complicated code.

  • @Pedro5antos_
    @Pedro5antos_ ปีที่แล้ว

    This was so interesting to watch!
    AWESOME

  • @tanglesites
    @tanglesites ปีที่แล้ว +21

    Just wanted to add. This is the best channel on TH-cam. Without it, I would still be scouring books and the armpit of the internet trying to figure out what the "out" and "in" keywords are doing in a generic declaration. I hope ChatGPT finds a place in society without putting people on the street, and so Nick and Content Creators like can keep making content, because University is F****** expensive.

  • @cmilkau
    @cmilkau ปีที่แล้ว +1

    For me, this is like the first time I got to interact with a computer. There's this extremely powerful and versatile tool, and you just want to see what you can achieve with it. That's what got me into coding. I don't understand the fears of "getting replaced" at all. It's not like there is nothing to do for software companies. And with these kind of tools, cost should go down, which may create even much more demand.
    I mean, in the long run probably every profession will undergo some decline, being replaced by new professions. For one, that's not around the corner in software. Two, who says we can't do those new professions? Three, that would probably be an upgrade as well.

    • @yomer355
      @yomer355 ปีที่แล้ว

      Agreed

  • @AthelstanEngland
    @AthelstanEngland 7 หลายเดือนก่อน

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

  • @andyt1313
    @andyt1313 ปีที่แล้ว +4

    From what I understand people's inputs are digested and used as continuing training for future iterations of the model. So you are basically training chatgpt to be better.

  • @bonzo6989
    @bonzo6989 ปีที่แล้ว +4

    This tool WILL decrease demand and salaries in IT field no doubt about that. The question is when and what to do to slow it down

  • @ulhaschaudhary5505
    @ulhaschaudhary5505 ปีที่แล้ว

    Hi Nick,
    Love all your videos and I have learnt and understood things from it.
    Can you create videos on Hugging face which AI partner with AWS

  • @fishzebra
    @fishzebra ปีที่แล้ว

    Thanks Nick, your channel is awesome. We need to raise our levels of abstraction as coders to speak a common language with AI.

  • @carldaniel6510
    @carldaniel6510 ปีที่แล้ว +3

    Nice demo! I think refactoring is one of the most straightforward and useful applications for models like GPT. While I would expect a senior developer to have been able to do this refactoring in only a few minutes, the fact is, as you pointed out, many could not, and less senior developers might never get there, even with a lot of prompting. This and the use as a more interactive form of documentation (e.g. "show me how to use the lag function in SQL") should be integrated into development environments ASAP. These kinds of tool free up congitive space in the brains of developers to actually spend their time developing, and less time going through the mechanics of typing and retyping code.

    • @jrcscomputing4618
      @jrcscomputing4618 10 หลายเดือนก่อน

      Refactoring that code though was not a simple task. It isn't just breaking it out into new methods.

  • @AlexSchwartzATV
    @AlexSchwartzATV ปีที่แล้ว +3

    It seems like you still need to know what youre doing and what to ask for, but since its doing the grunt work you can get it done much faster.

  • @ServandoPestano
    @ServandoPestano ปีที่แล้ว

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

  • @jamesmussett
    @jamesmussett ปีที่แล้ว +3

    I've been playing around with GPT 4 over the past few days and I'm beyond impressed at this point. In some instances, there's still a lot of handholding that needs to be done to make it fully aware of certain performance and architectural improvements, but I'm in the process of writing a custom persona for GPT that should hopefully remedy some of it's shortcomings.

  • @valentinnikolov2474
    @valentinnikolov2474 ปีที่แล้ว +1

    Hey Nick.
    I am junior to mid developer and can see the power of chat gpt.
    One question I got was what would be the best way to harness its power in order to advance in my career.
    Would you give me an answer or maybe a potential video idea.
    "How would you use it to advance if you were less experienced?"
    Maybe how to learn with chat gpt, how to use it in personal projects, what are the pros what are the cons... etc.

    • @chadknudson
      @chadknudson ปีที่แล้ว

      I think the best way to harness the power of ChatGPT as a mid-level engineer is to use it to help you in your daily tasks and to view its results with a critical eye, in the same way you would do when conducting a code review. As you saw in the video, it isn't going to get things 100% correct and optimal each and every time. It relies on you to guide it down the path of finding the correct solution. You can ask ChatGPT to produce explanations for you which when you ask it to produce or refactor code for you so that you can use it as a learning tool. You can ask for citations for the decisions that are made and go to those source materials to learn about the underlying concepts.

  • @Mosern1977
    @Mosern1977 ปีที่แล้ว +2

    Had some crazy code made by some other developer that I didn't understand, told ChatGPT 3.5 to refactor it. It confidently did, unfortunately it failed to do it correctly.
    But wonder if ChatGPT 4.0 will be able to do things like that.
    Cannot wait to it being introduced directly into Visual Studio - refactor old shitty program => bam - new program with nice comments etc.

  • @OBGynKenobi
    @OBGynKenobi ปีที่แล้ว +1

    now imagine this thing 5 years from now. Crazy!!

  • @MaxQuagliotto
    @MaxQuagliotto ปีที่แล้ว +3

    Ok this is crazy-good (and crazy-concerning). Your previous video I had doubts about ChatGPT with existing codebase but this is pretty powerful. Still, it will take a lot of time with even more complex and larger codebases which are probably even more 'poorly coded' but the progress ChatGPT has shown is very impressive.

    • @needsloomis7164
      @needsloomis7164 ปีที่แล้ว +4

      Also keep in mind this is ChatGPT not DeveloperGPT. It will be interesting once they train a version on some 40 years of real world code bases, quality refactors, and tons of books on the subject

    • @pneumonoultramicroscopicsi4065
      @pneumonoultramicroscopicsi4065 ปีที่แล้ว

      One day all code will be well coded because it's all made by AI lmao

    • @pneumonoultramicroscopicsi4065
      @pneumonoultramicroscopicsi4065 ปีที่แล้ว

      @@needsloomis7164 you mean github copilot when it receives gpt4 update

    • @needsloomis7164
      @needsloomis7164 ปีที่แล้ว +1

      @@pneumonoultramicroscopicsi4065 Then concepts like code readability wont even be applicable, since AIs only use human languages for our sake. Maybe some day ask for a program and get a straight machine code executable back.

  • @judewalker3657
    @judewalker3657 ปีที่แล้ว

    Really interesting. Thanks

  • @GustyBroadcast
    @GustyBroadcast ปีที่แล้ว +4

    Absolutely insane stuff! Each and every additional word that open-ai adds to chatGPT's "eyeballs" the more advanced it'll be.

    • @badpuppy3
      @badpuppy3 ปีที่แล้ว +1

      Law of diminishing returns will eventually triumph.

  • @gridlocdev2023
    @gridlocdev2023 7 หลายเดือนก่อน

    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!

  • @xybersurfer
    @xybersurfer ปีที่แล้ว

    that was pretty interesting, it still needs some hand holding, but it does most of the work. i wonder if those little bugs can be avoided. 9:36 try to be careful using suggestive words like "But"

  • @patrickdahl937
    @patrickdahl937 ปีที่แล้ว

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

  • @michaelrall8142
    @michaelrall8142 ปีที่แล้ว +2

    I love the expression on your face, when you look at the output and are at the point where you can see where the answer is going to - great. As a developer for 25 years this is a tool I often dreamt of, just tell it what you want to achieve, make critical questions, tell it to do some changes in the way you would like to, and stop typing all this dump code, that repeats over and over again 🙂

  • @cn-ml
    @cn-ml ปีที่แล้ว +4

    I cannot understand how AI as improved so incredibly fast. This is seriously impressive and not all developers would have passed the interview as good this?

    • @ammar0466
      @ammar0466 ปีที่แล้ว +1

      Ai development will be exponential too fast maybe next month gpt6

    • @victoriap1561
      @victoriap1561 ปีที่แล้ว +2

      ​@@ammar0466nope, the hardware to train it hasn't evolved that fast

    • @ajp2206
      @ajp2206 ปีที่แล้ว +1

      @@victoriap1561 yep. Hardware limitations are the biggest setback for AI development currently

    • @ChronicTHX
      @ChronicTHX ปีที่แล้ว

      SImple, lot of electricity that is gonna start to be seen in the price of those services, and lot of computing power (cpu/graphic cards).
      Things are not getting magicaly better, there is a hardware bottleneck to this, and an energy one that no one seems to see, adding that to the societal issues (plagiarism, job destruction), privacy issues (who is the master of the data). AI is a subject that needs to be talked about on non technical pov too. WHat's the price of this for our societies ?

    • @tygerovi
      @tygerovi ปีที่แล้ว +4

      @@ChronicTHX Instead of focusing on researching new technologies and medical issues like cancer etc, they are too busy replacing existing jobs for the sake of subscription money. What a failed evolution.

  • @vasilymeleshko
    @vasilymeleshko ปีที่แล้ว +2

    Idea for next experiments: compare couple DirectX or OpenGL versions and try optimize source code for graphics...

  • @PhaaxGames
    @PhaaxGames ปีที่แล้ว +8

    Comment written by AI, because I'm lazy... (I'm amazed that it could create a working regex from the mess I gave it 🤯)
    Hey everyone! I recently used ChatGPT-4 to help me extract and format data from a messy lunch menu HTML text. I described my problem to ChatGPT-4 and it provided me with JavaScript code snippets that addressed my concerns. Throughout the process, I was able to give feedback and request improvements, and the AI was incredibly responsive.
    In the end, we created a well-structured lunch menu object from the HTML text, which included all the necessary information for each weekday. I'm truly impressed by how ChatGPT-4 made this process so much easier and efficient. It felt like having a coding buddy by my side. Can't wait to use it for more projects in the future!

  • @ref_softwaredevelopment5298
    @ref_softwaredevelopment5298 10 หลายเดือนก่อน

    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.

  • @codeforme8860
    @codeforme8860 ปีที่แล้ว +2

    OMG I love this, my last 3 jobs were rescuing failed projects due to bad practice. If this could take a 2 million line project I could help so many more organisations

  • @jd31068
    @jd31068 ปีที่แล้ว

    Pretty incredible

  • @grant1133
    @grant1133 ปีที่แล้ว +2

    Reminds me of ClearBanks interview test I done for some recruiter, who totally ghosted me after i submitted it.
    Good times

    • @nickchapsas
      @nickchapsas  ปีที่แล้ว +1

      This one was the ASOS test. ClearBank might be using it too

  • @jespermattsson816
    @jespermattsson816 ปีที่แล้ว +3

    Since this is a known interview question, there are probably several pages on the net explaining how to do that specific example. As such, the example and how to solve it is probably part of the training data for the AI model.
    It would be really interesting to see how it does on an example that it hasn't seen before.
    From what I have seen and tested of ChatGPT (although the older model), if you challenge it on something it quickly agrees with you, even if your challenge is actually wrong. If you do make a follow-up to this video, making it motivate its decisions (such as not correcting the spelling or "firname") would be really interesting to see.

    • @QQQQQAQQQQQ
      @QQQQQAQQQQQ ปีที่แล้ว

      Exactly, you can even challenge it on things that are undeniably simple and true and it will still apologize and agree with your completely wrong suggestion.

  • @IElial
    @IElial ปีที่แล้ว

    What about knowledge of this test interview from GPT model ? (I mean it might be scraped for its data base learning ?) Or something kinda similar (We can think this interview code follow a similar pattern to another scraped data) ?
    It would be hard to know exactly what datas have fed GPT, but can't we imagine an very unusual code base (something it is very unlikely to have learnt) to refactor instead ?

  • @lee4547
    @lee4547 ปีที่แล้ว +5

    Super simple Legacy program refactor. In a perfect world where all code works like Lego pieces and dependencies are injected this tool would eliminate the need for programmers, but that's not the world I've worked in.

  • @_FLOROID_
    @_FLOROID_ ปีที่แล้ว

    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.

  • @ihatethesensors
    @ihatethesensors ปีที่แล้ว

    That was great my reaction was about the same.

  • @anthonybisong6744
    @anthonybisong6744 ปีที่แล้ว

    Great GPT4 video

  • @nihatdemir2000
    @nihatdemir2000 ปีที่แล้ว

    Excellent work. Keep creating videos how to use GPT4 in development and give us tips, tricks, commands to use and samples please.

  • @MrMattberry1
    @MrMattberry1 ปีที่แล้ว +1

    Definitely better than version 3.5, you did have to know what you were doing to get it right, and that knowledge makes a difference. The solutions I work on have over a hundred projects in them, so bit harder to copy and paste. They also communicate between multiple api's, so bit harder to get it to help. Definitely a good tool though, can't wait for it to be available to general public.

  • @babyfox205
    @babyfox205 ปีที่แล้ว

    How long is the context window you use, 32k? What is the maximum possible length of a coherent codebase that it can work with? I assume 32k tokens is the max it can operate with?

  • @megaman2016
    @megaman2016 ปีที่แล้ว

    That credit limit check < 500 should have been put in the credit limit provider so that it can be tested

  • @Nohim2YS
    @Nohim2YS ปีที่แล้ว +6

    In a real world scenario, exposing a proprietary code base to ChatGPT to refactor would be a really dangerous.

    • @brijendrasai1513
      @brijendrasai1513 ปีที่แล้ว

      Github copilot is about to be integrated with chatGPT
      Bye Bye easy programming money

    • @KennyomarGarcia
      @KennyomarGarcia ปีที่แล้ว +1

      Makes me think, if Microsoft owns Github and TFS, also they are connected to OpenAi. What tells you everyone's code (in a repository) is not already exposed to OpenAi/ChatGPT?

    • @socalkol
      @socalkol ปีที่แล้ว

      @@KennyomarGarcia user agreements/TOS i imagine

    • @alexandrgoncharov7975
      @alexandrgoncharov7975 ปีที่แล้ว

      There was a breach in chatGPT search history, that exposed the history of prompts of other user, and that exposed quite a lot of NDA code base to the internet.

  • @MattMadgarr
    @MattMadgarr ปีที่แล้ว +52

    I can't lie, I'm getting a liiiiiitle bit of anxiety from this AI, I'm an okay developer but I feel like this could probably replace me at some point, maybe already

    • @cromeromail
      @cromeromail ปีที่แล้ว +1

      Then become a Chat GPT expert

    • @helmedfox9559
      @helmedfox9559 ปีที่แล้ว +12

      Same here. This thought is not leaving me the whole week, since OpenAI made their live stream.
      Before this I was calming myself by saying "well, it still struggling to understand things if they are not clear enough, you still need a developer to put things together", now when I saw how it creates a website based on some 5 min sketch, I lost my peace of mind

    • @djrmarketing598
      @djrmarketing598 ปีที่แล้ว

      I feel the same way as you do, I consider myself a decent system architect (taking a described business model or idea and transcribing it into a working prototype), but in the majority of the one-off prototypes I find that I'm just doing quick and dirty stuff to get it going like putting EF code right into a UI component. What I realized by watching it refactor code is often I've made "design patterns" in my code but not the standard type but my own sort of designs. ChatGPT has had me recently refactoring a lot of my code I'm making now into injectable design patterns so the "future version" (if there is one on a prototype) is a lot cleaner. Although it looks to me I can almost send my busy work to ChatGPT now.

    • @pneumonoultramicroscopicsi4065
      @pneumonoultramicroscopicsi4065 ปีที่แล้ว +1

      @@helmedfox9559 more like 5 seconds sketch, that sketch definitely could've been better

    • @rumble1925
      @rumble1925 ปีที่แล้ว +3

      It's a tool that will help you write more and better code. You should be excited you don't have to do the repetitive and boring parts anymore, you will be able to model your system and test ideas and validate them extremely fast.

  • @LudwigvanBeethoven2
    @LudwigvanBeethoven2 ปีที่แล้ว +2

    At this point I no longer believe those who say "AI does not understand"

  • @eaudesolero5631
    @eaudesolero5631 ปีที่แล้ว +2

    Can you simply ask it ' what are some limitations to the code you just provided me or some problems that may arise in the future?'

  • @aveekbiswas2176
    @aveekbiswas2176 ปีที่แล้ว

    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?

  • @CiaranGallagher1
    @CiaranGallagher1 ปีที่แล้ว +10

    I cannot fathom how this even works.It's insane!

    • @JayVal90
      @JayVal90 ปีที่แล้ว

      A few decades of helpful programming blog posts as training data really helps, combined with the highly pattern-based nature of the questions being answered (which is precisely what these generative AI's are designed to do well).

  • @Amitkumar-dv1kk
    @Amitkumar-dv1kk ปีที่แล้ว

    How would it perform in competitive coding, like that on the leetcode, they tend to involve complex thinking processes in order to solve them, that would give an estimate of how much thinking does gpt4 actually does.
    Now i can't test it out myself because I don't have plus membership neither do I wish to, because I don't have it's use right now.
    chatGPT would fail horribly I know, it had failed for the very trivial of the coding problems for me, so I just want to see how gpt4 would perform.

  • @pilotman9819
    @pilotman9819 ปีที่แล้ว +2

    Looks like this will cut down tech jobs by 80%. The remaining 20% will be there to just hold its hand a bit and push/nudge it in the right way.

  • @higherbeingX
    @higherbeingX ปีที่แล้ว +2

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

    • @nidungr3496
      @nidungr3496 ปีที่แล้ว

      It's not just devs, it's every white collar career. Lawyers, artists, teachers, writers, engineers, architects, office assistants, medical doctors, sales, HR, industrial designers - all of them can and will be replaced by an AI that does their job better, faster and cheaper. Developers just happen to be replaceable by stock GPT-4 while the other sectors require some level of specialized tooling.
      This is the abrupt end of the 20th century knowledge economy, with even OpenAI predicting 40-50% unemployment within a few years (the Great Depression was 25% at worst) and most likely second order effects such as a collapse of demand for non-industrial blue collar jobs, a massive oversupply of desperate people pouring into manual jobs, bank failures due to large amounts of foreclosures, and all this will be fertile ground for political extremist takeovers or revolutions. (Don't forget that a massive economic crisis was what toppled the Weimar republic.)
      Good luck bartending, lol.

  • @plamenstoyanov5605
    @plamenstoyanov5605 ปีที่แล้ว

    Nick: How scprited this video i want to be?
    Nick: Yes

  • @jurassa9588
    @jurassa9588 ปีที่แล้ว +1

    @Nick Chapsas I think you can agree with me that in order to be productive with this thing your have to first master your craft. Give F35 to normal pilot he cannot do much.

  • @antonmartyniuk
    @antonmartyniuk ปีที่แล้ว +1

    How to send an image to ChatGPT 4? I want to try and ask it to create a microservice on Net from a photo of the database schema on the whiteboard

  • @pedroferreira9234
    @pedroferreira9234 ปีที่แล้ว +7

    I'm using GPT-4 and the moment you go to deep stuff it starts failing again even some basic stuff it fails but is better than gpt-3.5 for sure

  • @user_ahfvjjfb
    @user_ahfvjjfb ปีที่แล้ว +3

    This is absolutely amazing and really scary, we're easily replaceable now. GOOD JOB!

    • @cmilkau
      @cmilkau ปีที่แล้ว +1

      Has anyone been replaced yet? The demand for software has not nearly been exhausted. For now, expect more to be done with the same people, not the same with less people

  • @watherby29
    @watherby29 ปีที่แล้ว +4

    No wonder it writes good code. It learned from senior devs code. I am waiting for it to be creative before I become a plumber.

  • @shibalogic5269
    @shibalogic5269 ปีที่แล้ว

    Do you think there agp-4 will be able to make 3d rigged models rendering character creation obsolete? Essentially allowing someone to generate character for their games?

  • @ManeshBPandu
    @ManeshBPandu ปีที่แล้ว

    Very nice way to use the AI ChatGPT... Noce job by a machine.

  • @BrazenNL
    @BrazenNL ปีที่แล้ว

    You know what's also fun? If you get an error (at least, with Rust), you can paste the errors and it'll try again.

  • @ztBlackGad
    @ztBlackGad ปีที่แล้ว +1

    Hey Nick. Can you try to upload source code to chat as base64 of regular zip and ask it to convert and unzip code. Afterwards refactor? And to receive response ask it to zip and show you base 64 of that thip file?)

  • @a13w1
    @a13w1 ปีที่แล้ว +1

    Do wonder how well it will be to upgrade old versions of react to modern versions (I guess it depends on how up to date data this references)

  • @ifstatementifstatement2704
    @ifstatementifstatement2704 ปีที่แล้ว

    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.

  • @gavrihak
    @gavrihak 10 หลายเดือนก่อน

    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?

  • @agsystems8220
    @agsystems8220 ปีที่แล้ว +1

    Huh, so what happens if you prime one instance of GPT4 to do stuff, and a second to act as an interviewer looking for bugs, and then get them to have a conversation with each other? It seems to be decently aware of it's mistakes in retrospect, so is it possible to get it to do so on it's own? It is massively impressive that it can do that side of the conversation, but could it also provide your side?

    • @agsystems8220
      @agsystems8220 ปีที่แล้ว

      My understanding is that it's "Mind's eye" isn't perfect, so it may actually just work better if you prompt it to do multiple passes rather than expect it to produce something fully formed.

    • @gabrielonibudo5566
      @gabrielonibudo5566 ปีที่แล้ว

      Someone needs to try this out ASAP!

  • @georgiosdrosinos9530
    @georgiosdrosinos9530 ปีที่แล้ว

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

  • @devnami
    @devnami ปีที่แล้ว

    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?

  • @RedOneM
    @RedOneM ปีที่แล้ว +2

    GPT-10 will be able to replace 90%+ of jobs with thought processes.
    Now once infrastructure is build around robots, there's no much what common people are able to do anymore as a job.

  • @ShiroKage009
    @ShiroKage009 ปีที่แล้ว

    An interview question is a bad idea since it probably exists on the internet already

  • @ikarosound2504
    @ikarosound2504 ปีที่แล้ว

    This was exactly the kind of thinks that are looking for!
    I love your channel! Thanks for the video
    I can subscibe also for just 1 month to gpt plus, right?

    • @nickchapsas
      @nickchapsas  ปีที่แล้ว

      Yeah I’m pretty sure you can subscribe monthly but cancel at any time

  • @MikkoRantalainen
    @MikkoRantalainen ปีที่แล้ว

    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.

  • @muttley4989
    @muttley4989 ปีที่แล้ว

    Is this code available to download?
    Both pre and after ChatGTP?

  • @nguyenvi_cntt
    @nguyenvi_cntt ปีที่แล้ว

    oh how great it is

  • @danielbrown7534
    @danielbrown7534 ปีที่แล้ว

    This dude is basically interviewing chat gpt 🙆🏾 and he saying it doing good.. I doubt I'd be getting that job 😂

  • @mathiasdemestral9411
    @mathiasdemestral9411 ปีที่แล้ว

    We are one step away of the motto of this channel being "keep chatting" 😬

  • @Joooooooooooosh
    @Joooooooooooosh ปีที่แล้ว

    That 32K token limit does not apply to chat GPT and likely won't anytime in the near future. The 32K model costs a fortune and is only available via the API.

  • @angryktulhu
    @angryktulhu หลายเดือนก่อน

    Any better way to do that in 2024? Better tools, prompts, etc? Especially for big codebase? I tried Aider but it really drains the money too much…

  • @garcipat
    @garcipat ปีที่แล้ว +1

    This is a Senior interview? A professional does need to know this too...