I Asked GPT-4 To Refactor My Legacy Codebase

  Рет қаралды 348,630

Nick Chapsas

Nick Chapsas

Жыл бұрын

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

Пікірлер: 472
@dmitryborovych9135
@dmitryborovych9135 Жыл бұрын
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 Жыл бұрын
2028: ChatGPT-N asking ChatGPT-N to refactor ChatGPT-N
@f220696
@f220696 Жыл бұрын
2030: ChatGPT-N "Hello everybody I'm ChatGPT-N and in this video i wil..."
@almadesperado
@almadesperado Жыл бұрын
2027 => "2024: ChatGPT-N asking Nick to refactor the legacy code to offload servers"
@theyspeakagain
@theyspeakagain Жыл бұрын
2040: ChatGPT refactors Nick's genetic code
@sherryssj5
@sherryssj5 Жыл бұрын
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 Жыл бұрын
Shows that, just like search engine skills, you still need to know what you want, and how to review good code.
@lemmack
@lemmack Жыл бұрын
For now.
@Nnm26
@Nnm26 Жыл бұрын
@@lemmack well said
@ytchannel6569
@ytchannel6569 Жыл бұрын
@@lemmack For now for us.
@alansmithee419
@alansmithee419 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
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 Жыл бұрын
Your comment killed me lol
@badpuppy3
@badpuppy3 Жыл бұрын
Are you not finding the future to be as great as we were promised??
@kingblade1419
@kingblade1419 Жыл бұрын
They say, you will own nothing and you will be happy, Matrix? 🤔
@wasabinator
@wasabinator Жыл бұрын
Well your boss will also be an AI so maybe they will be helping you sweep
@anderj235
@anderj235 Жыл бұрын
@Tim Laursen, Tesla will beat Boston Dynamics to mass production of a mechanical handyman.
@eclipxs6340
@eclipxs6340 Жыл бұрын
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 Жыл бұрын
This sounds like the Obama medal meme
@eaudesolero5631
@eaudesolero5631 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 !
@AvenDonn
@AvenDonn Жыл бұрын
What a time to be alive!
@Linkario86
@Linkario86 Жыл бұрын
@@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.
@EPK_AI_DUBS
@EPK_AI_DUBS Жыл бұрын
Please keep doing these type of prompt engineering videos with GPT-4, I really enjoy them! Great work
@okerror1451
@okerror1451 Жыл бұрын
you're so polite to the AI
@nickchapsas
@nickchapsas Жыл бұрын
It might be my future overlord so I have to play the long game
@agsystems8220
@agsystems8220 Жыл бұрын
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 Жыл бұрын
That way you treat those with less power than yourself says a lot about your character.
@alexandruchirita5780
@alexandruchirita5780 Жыл бұрын
​@@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 😂
@Horesmi
@Horesmi Жыл бұрын
-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 😂
@thygrrr
@thygrrr Жыл бұрын
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.
@sqwert654
@sqwert654 Жыл бұрын
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.
@Beltalowda55
@Beltalowda55 Жыл бұрын
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 Жыл бұрын
Hi Nick! See you under the bridge in a couple of years!
@nickchapsas
@nickchapsas Жыл бұрын
Can't wait to start my beekeeping operation
@mirekmiedziarek51
@mirekmiedziarek51 Жыл бұрын
@@nickchapsas I'm afraid that beekeping will be handled by AI powered machines anyway :D
@niksatan
@niksatan Жыл бұрын
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
@Scroapy
@Scroapy Жыл бұрын
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 Жыл бұрын
d/ then your and old company is not needed since there might be a lot of them
@Scroapy
@Scroapy Жыл бұрын
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
@everythingiscoolio
@everythingiscoolio Жыл бұрын
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.
@refactorear
@refactorear Жыл бұрын
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.
@ClaytonHunt
@ClaytonHunt Жыл бұрын
This is Awesome, can't wait to unleash it on some of our legacy codebases!
@maxpkr
@maxpkr Жыл бұрын
Developers who write code might become legacy
@dawid_dahl
@dawid_dahl Жыл бұрын
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 Жыл бұрын
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.
@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.
@SomeKindOfMattias
@SomeKindOfMattias Жыл бұрын
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 Жыл бұрын
I mean, not only did it break things in small methods but it also extracted into classes
@SomeKindOfMattias
@SomeKindOfMattias Жыл бұрын
@@nickchapsas Ask it to make a state machine *BOOM* all business logic in one go :)
@worldinstyle
@worldinstyle Жыл бұрын
Learned a lot in a few minutes. can u do similar videos of refactoring please with gpt4 and ur added reasoning and explanation.
@Pedro5antos_
@Pedro5antos_ Жыл бұрын
This was so interesting to watch! AWESOME
@seredaom
@seredaom Жыл бұрын
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
@bonzo6989
@bonzo6989 Жыл бұрын
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
@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.
@tanglesites
@tanglesites Жыл бұрын
Just wanted to add. This is the best channel on KZbin. 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.
@andyt1313
@andyt1313 Жыл бұрын
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.
@nedames3328
@nedames3328 Жыл бұрын
You can opt out
@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.
@PhaaxGames
@PhaaxGames Жыл бұрын
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!
@judewalker3657
@judewalker3657 Жыл бұрын
Really interesting. Thanks
@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.
@carldaniel6510
@carldaniel6510 Жыл бұрын
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.
@cmilkau
@cmilkau Жыл бұрын
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
@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.
@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
@attribute-4677
@attribute-4677 Жыл бұрын
I’ve got Plus, but when I hit new chat, I don’t have a model selector. Anyone else have this issue?
@jamesmussett
@jamesmussett Жыл бұрын
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.
@AlexSchwartzATV
@AlexSchwartzATV Жыл бұрын
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.
@anthonybisong6744
@anthonybisong6744 Жыл бұрын
Great GPT4 video
@antonmartyniuk
@antonmartyniuk Жыл бұрын
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
@MaxQuagliotto
@MaxQuagliotto Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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.
@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?
@cn-ml
@cn-ml Жыл бұрын
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 Жыл бұрын
Ai development will be exponential too fast maybe next month gpt6
@victoriap1561
@victoriap1561 Жыл бұрын
​@@ammar0466nope, the hardware to train it hasn't evolved that fast
@ajp2206
@ajp2206 Жыл бұрын
@@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 Жыл бұрын
@@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.
Жыл бұрын
how do you paste all the code to chatgpt? everytime I try to paste something long I get the "too long" error I've tried putting the code on a gist and giving the link, but it doesn't work
@OBGynKenobi
@OBGynKenobi Жыл бұрын
now imagine this thing 5 years from now. Crazy!!
@Mosern1977
@Mosern1977 Жыл бұрын
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.
@ServandoPestano
@ServandoPestano Жыл бұрын
It is really impressive (all about) this tool. And this is just the beginning...
@MattMadgarr
@MattMadgarr Жыл бұрын
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 Жыл бұрын
Then become a Chat GPT expert
@helmedfox9559
@helmedfox9559 Жыл бұрын
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 Жыл бұрын
@@helmedfox9559 more like 5 seconds sketch, that sketch definitely could've been better
@rumble1925
@rumble1925 Жыл бұрын
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.
@patrickdahl937
@patrickdahl937 Жыл бұрын
Love you video, imagine when it can read an entire technical document to gain domain knowledge and translate to code...
@pedroferreira9234
@pedroferreira9234 Жыл бұрын
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
@jd31068
@jd31068 Жыл бұрын
Pretty incredible
@gridlocdev2023
@gridlocdev2023 9 ай бұрын
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!
@GustyBroadcast
@GustyBroadcast Жыл бұрын
Absolutely insane stuff! Each and every additional word that open-ai adds to chatGPT's "eyeballs" the more advanced it'll be.
@badpuppy3
@badpuppy3 Жыл бұрын
Law of diminishing returns will eventually triumph.
@grant1133
@grant1133 Жыл бұрын
Reminds me of ClearBanks interview test I done for some recruiter, who totally ghosted me after i submitted it. Good times
@nickchapsas
@nickchapsas Жыл бұрын
This one was the ASOS test. ClearBank might be using it too
@valentinnikolov2474
@valentinnikolov2474 Жыл бұрын
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.
@codeforme8860
@codeforme8860 Жыл бұрын
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
@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?
@vasilymeleshko
@vasilymeleshko Жыл бұрын
Idea for next experiments: compare couple DirectX or OpenGL versions and try optimize source code for graphics...
@jespermattsson816
@jespermattsson816 Жыл бұрын
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.
@AthelstanEngland
@AthelstanEngland 9 ай бұрын
This code is above my understanding but this is still perhaps one of my favourite videos just cos of your reactions! 😅
@eaudesolero5631
@eaudesolero5631 Жыл бұрын
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?'
@pilotmanpaul
@pilotmanpaul Жыл бұрын
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.
@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?
@zyzhang1130
@zyzhang1130 Жыл бұрын
How do you refactor an entire repository though
@gavrihak
@gavrihak 11 ай бұрын
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?
@Nohim2YS
@Nohim2YS Жыл бұрын
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 Жыл бұрын
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.
@michaelrall8142
@michaelrall8142 Жыл бұрын
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 🙂
@lumyrecordsc3111
@lumyrecordsc3111 Жыл бұрын
how did you unlock gpt-4 ?
@muttley4989
@muttley4989 Жыл бұрын
Is this code available to download? Both pre and after ChatGTP?
@lee4547
@lee4547 Жыл бұрын
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.
@LudwigvanBeethoven2
@LudwigvanBeethoven2 Жыл бұрын
At this point I no longer believe those who say "AI does not understand"
@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 ?
@_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.
@watherby29
@watherby29 Жыл бұрын
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.
@enriqueflorendo
@enriqueflorendo Ай бұрын
If code is in folders, how would you feed it that?
@megaman2016
@megaman2016 Жыл бұрын
That credit limit check < 500 should have been put in the credit limit provider so that it can be tested
@LuckyLukas90
@LuckyLukas90 Жыл бұрын
can someone explain me what was the problem with the DateTime.now approach? unfortunately i didn't understand it in the video.
@nickchapsas
@nickchapsas Жыл бұрын
Check this: kzbin.info/www/bejne/i2S0p4eXrJdlatE
@MaxQuagliotto
@MaxQuagliotto Жыл бұрын
@@nickchapsas So the problem is not the code itself, it's just the testability of the code that's the problem.
@MaxQuagliotto
@MaxQuagliotto Жыл бұрын
@@mhoertnagl any time the method is called shouldn’t Datetime.Now always pull the time from system clock regardless of lifetime of the validator class? I figured the real issue is that for unit testing you always want to have the same result which DateTime.Now inherently cannot produce
@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?
@ihatethesensors
@ihatethesensors Жыл бұрын
That was great my reaction was about the same.
@maxnova9763
@maxnova9763 Жыл бұрын
How would this pan out if you give it a problem that isn't an interview question?
@nickchapsas
@nickchapsas Жыл бұрын
I tried it with more code and it’s still pretty good. The better the questions you ask the better the results you get back
@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.
@user_ahfvjjfb
@user_ahfvjjfb Жыл бұрын
This is absolutely amazing and really scary, we're easily replaceable now. GOOD JOB!
@cmilkau
@cmilkau Жыл бұрын
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
@nguyenvi_cntt
@nguyenvi_cntt Жыл бұрын
oh how great it is
@RedOneM
@RedOneM Жыл бұрын
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.
@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.
@jurassa9588
@jurassa9588 Жыл бұрын
@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.
@ManeshBPandu
@ManeshBPandu Жыл бұрын
Very nice way to use the AI ChatGPT... Noce job by a machine.
@CiaranGallagher1
@CiaranGallagher1 Жыл бұрын
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).
@higherbeingX
@higherbeingX Жыл бұрын
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.
@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.
@Forshen
@Forshen Жыл бұрын
at 04:18 We also have Static code from a dependency code base, so we created a Adapter with the name based on the class with the statis methods, example: "ProductAdapter" and the adapter has the same methods as the static class and the adapter methods just calls the static methods. Is this a good way?
@nickchapsas
@nickchapsas Жыл бұрын
Yeah it's the same thing. Normally it's called an adapter but you can also call it proxy, forward method or wrapper.
@Forshen
@Forshen Жыл бұрын
@@nickchapsas ah thanks. Still trying to learn differences between design patterns. But proxy, wrapper, adapter and 'forward method' are all the same thing? I thought there was a difference for the proxy tho, never understood it. But now I know, thanks.
@paulkoopmans4620
@paulkoopmans4620 Жыл бұрын
​@@Forshen Technically "Adapter" and "Proxy" are indeed different things. But they do get mixed up a lot of times. But it is all in the names! 1. Adapter (also called wrapper) => A class that implements an interface, or extends from a base or abstract class and 'wraps'/encapsulates another class. The purpose of the adapter class is to implement the "contract" and forward them to the wrapped class. The wrapped class never had the proper interface but your adapter does the right stuff to make it happen. Think the little adapter plugs you use when you travel to a different country; you adapt the one interface to the other; 2. Proxy => a class that implements an interface and encapsulates a class with that same interface. The purpose of the proxy is to add behaviour either before, after or both and 'proxy'/forward it to the encapsulated class. Think a WattMeter; same prong style but the added value is now you are 'logging' traffic.
@Forshen
@Forshen Жыл бұрын
@@paulkoopmans4620 ah well, that makes a lot of sense to be honest. Thanks!
@iankynaston-richards5239
@iankynaston-richards5239 Жыл бұрын
I've been able to get Chat GPT to fabricate large amounts of information loosely based on factual data. It was not making the occasional mistake, it was making stuff up in a very believable way.
@agsystems8220
@agsystems8220 Жыл бұрын
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!
@ztBlackGad
@ztBlackGad Жыл бұрын
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?)
@StefanoGabriele1983
@StefanoGabriele1983 8 ай бұрын
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?
@MarkoMijuskovic
@MarkoMijuskovic Жыл бұрын
Well,... time to switch to woodworking... always wanted to do something with wood and here is my chance...
@nhtdmr
@nhtdmr Жыл бұрын
Excellent work. Keep creating videos how to use GPT4 in development and give us tips, tricks, commands to use and samples please.
@plamenstoyanov5605
@plamenstoyanov5605 Жыл бұрын
Nick: How scprited this video i want to be? Nick: Yes
@georgebeierberkeley
@georgebeierberkeley Жыл бұрын
Uh, I'm glad I'm 59 and near the end of my career. If I were 25 I'd have serious anxiety over this. It'll take years to get as good as the machine.
@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.
How I Coded An Entire Website Using ChatGPT
18:22
Nick White
Рет қаралды 1,8 МЛН
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 112 МЛН
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 24 МЛН
Русалка
01:00
История одного вокалиста
Рет қаралды 3,8 МЛН
GPT-4 Makes Old ChatGPT Look Like a JOKE!
12:56
Nick Chapsas
Рет қаралды 426 М.
"I Lost a Job Because of This Codebase"
14:08
Nick Chapsas
Рет қаралды 61 М.
You Are WRONG About 0 Based Indexing
25:02
ThePrimeTime
Рет қаралды 251 М.
REAL Uses of ChatGPT As A Developer | 12 Practical Examples
21:31
Travis Media
Рет қаралды 76 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,4 МЛН
Why Developers Hate "Clean Code"?
14:39
Nick Chapsas
Рет қаралды 57 М.
Sam Altman New statement On GPT-5 Is Surprising!
12:56
TheAIGRID
Рет қаралды 126 М.
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
I Tried Every AI Coding Assistant
24:50
Conner Ardman
Рет қаралды 725 М.
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 112 МЛН