Using AI To Code Better? ChatGPT and Copilot change everything

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
oh no the AI it's coming for our jobs it's going to ruin programming competitions it's going to destroy the whole software Dev world or is it let's talk about it so y'all might have seen this new chat GPT thing it seems to have taken over the entire internet and in particular the entirety of my Twitter feed and I'm getting a lot of questions I'm seeing a lot of concerns a lot of excitement and honestly after playing with it starting to understand why some of the examples I have seen are nuts things as crazy as converting a PHP app to next.js just by pasting the code and telling GPT to do it I've been incredibly impressed but I'm also incredibly impressed with copilot I think that a lot of these tools are going to change How We Do development I don't think they're going to take away the need for developers though let's take a look at some of what chat gbt can do some of how I use copilot and why I think this is all so interesting right JavaScript code that generates the Fibonacci sequence and here is some code that creates a Fibonacci Sequence an example of how to use it and one of the most interesting things is that it gives you like in-depth descriptions of why it did each of these things and details about them do you know what an AI can't do like and subscribe to a video do you know who can though you likes are free don't tell the robots though buttons right there and it helps the channel out a ton thank you for that back to it but that's just telling it to write some basic JavaScript like the thing you do in an interview cool what about the stuff I do every day like I need to go redo the nav bar on my website with tailwind and react okay uh build me a navigation header for a web page using react typescript and Tailwind the header should have three links one two home one two blog and one to the about page let's start with that it even has an SVG for the home fascinating to use this header you can simply import into your rack component that's nuts shall we go throw this in an app and see how it looks have a stock empty create T3 app template with just Tailwind going to paste in the new header component and we're going to mount it here header that actually looks phenomenal I didn't think it was going to look that good I'm not sure how I feel about the color though let's ask it to change the color for us change the color of theme of the nav bar to be purple it even tells you in the text instruction here change BG gray 800 to BG purple 800. if we find this BG gray 800 see if that's the only one it is purple look at that make the background of the nav bar a gradient I'm just going to copy and you rank this guy I'm very curious how this looks that actually looks really good but what about more specific like math or domain problems what about something like Advent of code which as you all know I'm really into well uh let's go to Advent of code in day one and see if it can solve the problem generate JavaScript code that can complete the following prompt okay let's see this code sample list of calories so this is the sample list I think she has the one two three then four five six seven eight nine has Max calories Max elf for let I zero I is less than calories dot length I also uh I don't reduce so it sums them and if that is higher then it sets the max calories to that value pretty solid let's actually just take my test input and put it in generate an answer to the prompt with the following input sixty seven thousand five eight four is that right nope I'll just tell you that for iPhone day one I can kind of find the answer for Advent of code day two it absolutely can't and I want to show how other tools specifically copilot is able to help me as a developer deliver a solution faster so the problem tldr is you're given this list of numbers you have to sum how many or some the numbers that are grouped so split by these and then figure out what the max sum of one of those groups is so const input equals not smart enough to autocomplete for me oh look at that so do next there so the answer is already in this code base which is going to give this a slight technical Advantage but I just want to say when I did Advent of code and I did this problem and I actually managed to do this problem so fast that I was in the top 200 in the world the reason for that on the hottest day of Advent of code is because copilot carried my ass going to delete all of this and we're going to redo this one from scratch really quick so I can show you just how fast the co-pilot experience lets me move first I need the input so cost input equals and it's already going to auto complete the await for that const grouped equals input.split now I have the two groups so const uh so our group sums equals that's not quite right but from here I can still do a lot uh instead of answers maybe I'll change this to be const uh numbers equals perfect and then return numbers that reduce perfect now I have the group sums uh const Max equals I forgot to close this console.log Max and if I did this right I already have the terminal running there we are that's the answer 72017 cool so that let me solve that insanely quick let's go into part two now though it's okay we actually need the top three elves okay that's annoying thankfully I have this list so cons top three equals look at that const sum equals and then some and if I did that correctly there's the answer and if I look here that is the answer I put there as you can see the skill of copilot isn't necessarily knowing what code is right or wrong although when I got tripped up here during the group sums part that definitely helped the real trick is knowing how to translate what you're looking for into code keys that co-pilot is smart enough to then fill from there it still requires being clever but in a different way I'm not writing clever code I am solving this problem in a clever fashion by giving good names and keywords to uh copilot to then generate code more effectively like when I say kant's top three that's a good hint for the or for copilot to know it needs to generate something based on that or here when it was trying to do something weird with like the strings and sets but I wanted numbers I deleted the code and wrote const numbers and then it was able to do this correctly those are the tricks that make something like copilot so powerful where something like chat GPT almost in versus the dynamic where the code is wrong and then you have to explain to chat GPT how it's wrong and how it should change things and how it could improve from there Copilot almost feels like many Google searches as I'm coding and if it doesn't have the immediate right result I can change the search slightly and then if it does I apply it I really like how copilot shortens the feedback loop as a developer but I'm also really fascinated with how something like chat GPT fundamentally changes where the code comes from in the first place these tools are very interesting but both require you as a developer both to understand the code that's being generated and also be to be frank very careful when you apply that code because it might seem like it's doing the right thing and it just isn't there's a bunch of Clips like this video is going to be eight minutes long but I filmed this for over half an hour where I thought things were working and they weren't and vice versa and just cleaning stuff up that way can often be more work than writing it the correct way yourself all that said the stuff's super exciting if you want more videos about the chaos that is AI right now let me know and I'll get those soon anyways if you liked this please let me know in the comments YouTube thinks you're gonna like whatever video it's putting right there so definitely give that a shot if you like videos like this I hope to film more of them this one wasn't live and that's weird but I wanted to give this a shot let me know what you think peace nerds
Info
Channel: Theo - t3․gg
Views: 303,644
Rating: undefined out of 5
Keywords: web development, full stack, typescript, javascript, react, programming, programmer, theo, t3 stack, t3, t3.gg, t3dotgg, openai, ai, machine learning, gpt3, gpt4, copilot, ml, artificial intelligence
Id: yIZqIMNvqjg
Channel Id: undefined
Length: 9min 29sec (569 seconds)
Published: Sun Dec 04 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.