GitHub Copilot Just Changed the Game

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I don't know if you also have this feeling but I feel like we're all being completely overflooded by AI tools there's like a new tool coming out every day it's really hard to keep track of everything at iron Cults we've been using several AI tools we use things like notion AI Jasper alter for transcriptions and it becomes a bit problematic because things start to really overlap when I do software development I've tried to keep the number of tools that I use limited to not be completely overloaded so I've mainly been using two things which is GitHub copilot and chat GPT I've been doing that for the past couple of months and they fit together really well they're like a sandwich and cheese but for the past week I've been playing around with GitHub co-pilot chat which is in essence chat GPT integrated into vs code it's like a molten cheese sandwich Inseparable so I like it a lot I'll show you how it works and how it fits into my development workflow there's one feature though that if they added that and I'm sure it's definitely possible that would be a total Game Changer now ai tools are there to make our lives easier especially if you also choose the right Frameworks and programming languages python for example is great for processing data or training a machine learning model but building a web application is way more complicated because you have to deal with both front-end code back-end code creating user interface Etc type hype who's the sponsor of today's video is an application Builder that makes this really easy it's pure python it's open source and you can use it for free check it out it's really cool to get started you just type pip install type I or if you're using poetry poetry add type vital added to your Pi Project normal file you can use type I directly in vs code using the type I Studio extension and also works in Jupiter notebooks let's see how you can build a web application with this in just a few minutes using only python have a basic starter example here where I simply import the GUI object from type I and then create a page and run it this automatically creates a local web server and generates the HTML and this is what it looks like it's very easy to build out your web page and add more elements to it in this example I've added some text as well as an input element when you go to the website then this is what it looks like and the variables are actually updated dynamically as you'll see so that's really simple to use next to that if you use the type by Studio extension then you see that it offers autocomplete so you can easily add buttons charts dates dialogues anything that you need here I have a more involved example which also lets you switch between dark and light mode and it also shows a table and a chart based on a data frame and this is what that looks like in the browser type by is not just a GUI application Builder though type by core is not a part of the library to help you build data-driven back-end applications it gives your end user full control of the algorithms and pipelines with user-defined scenarios there's a complete orchestration engine and a ready-to-use rest API go to typewrite's GitHub page to check it out it's a link right here and I've also put this link in description now back to the video before you can use GitHub copilot of course you need to install the extension first so in order to do that nvs code just go to the extensions tab on the left and then you can simply search for the extension in the market place so you see that GitHub copile this here and you can click install to install it what I'm using in this video is vs code insiders which is more a better experience so I've also installed GitHub copilot nightly which has the latest GitHub copilot features and specifically that allows access to co-pilot chats if you are enrolled in that particular that's our program if not part of the battle problem you can simply install GitHub copilot to get started this is a pay tool though but I honestly think it's totally worth it as it saves me loads of time after you've installed GitHub copilot you're going to see this little GitHub copilot icon in the top right that you can use to activate or deactivate mobile because sometimes maybe you don't want to have these text completions you can simply deactivate it by clicking it and then disable it globally for all files or you can simply disable it for a specific type of file for example if you want to disable adjustable python you can simply click disable for python what this actually does is change the vs code settings so there is Json file example here I have my user settings for vs code so there's a couple of things here but specifically you see this part where GitHub copile is enabled by default true for everything but then we can also disable it for specific kinds of files and in this case there's python actually I do want to enable it for python so I'm simply going to remove this line but it's good to know that you can enable or disable the completions based on the file type so how does this actually work well it's simply going to propose all the completions while you're typing you can see it's there's a gray out area here which now suggests a string donor method and if I want to use this I can simply press Tab and then it's going to insert this completion for me and so I can simply continue writing so now it suggests this as a string version of the person so well I might like that so I simply accept that let's continue and see what other things it proposes so it also proposes a wrapper method so that is supposed to give a representation of the object for developers versus string donor method is more for users so as you can see it now proposes to do this if I don't want the insertion I can simply press escape and then I continue typing let's add another method so let's say we have a method print info and you see it also suggests typing so that's actually really useful and now it's going to print this so now it's suggesting this line but maybe I don't like this very much what you can also do is open a window that's going to suggest a couple of other things and to do that I tap control enter and then now it's going to create now it's going to generate different solutions for me which takes a little while but here we go we already have three solutions so there is this one that's this one and that's that one and then I can check which one I want for example maybe I just want this one because that just calls the string donor method so I click here and then it's going to insert the code in most cases while you're typing GitHub Copa is going to trigger Auto completions automatically if it doesn't for some reason you can also type option backslash or alt backslash on Windows and Linux to trigger copilot explicitly there's a couple of ways you can navigate through the possible Auto completions inside the editor itself let's say we have a function that computes a loom checks on based on the card number that you get so what you can also do is use option left or right bracket on Mac or alt left or right bracket on Windows and Linux to navigate between the different Available Auto completion so for example if I press here option right bracket it's going to suggest a slightly different Auto completion for the command and I can simply navigate through them so let's say I want this one and then now it suggested a particular implementation for the Loon Jackson function which by the way is a function to check if a credit card number is valid but perhaps I don't want this full algorithm I just want part of it and you can also do that by typing either control or Command right arrow key and if I do that so see it's simply doing it on a word by word basis so I can now simply accept this line and maybe this one I do want to have and now if I want so I can use option right bracket or left bracket to go through different possibilities so there is so this is one thing that's generated this is another thing just a single line so I simply press Tab and then have this then it suggests this so you see that by this way you can really easily navigate through the different odds completions select which one you want and work very quickly to come up with a decent algorithm in this case for The Loon Jackson by the way another thing you can do if you want to see what the possible suggestions are simply hover over the suggestion with your mouse and then you can see what the current suggestion is and pick another one if you want to and then simply press tab to select that particular suggestion what are the main ways in which I use GitHub copilot well one is to automatically add type annotations and Define basic classes for example if I have this person class and perhaps I'm currently writing the initializer it's already suggesting for me the rest of the methods header and including the type annotation so simply press Tab and then it's going to automatically create the code for me that I'm going to need so this saves me really loads of time other thing I'll do is writing simple functions or methods like the loan Jackson example that I showed you before another thing I do is to automatically complete imports from me for example I can type from data classes and then it's going to suggest import data class which is very helpful and now I can simply Define my data class here like so and then I can also use this to quickly create and fill in the rest of the details of a particular class for example here I have a class bank account so you see it already gives me an account number a balance deposit withdraw and a couple of other things that are going to be useful and then of course maybe I don't need everything so for example maybe I don't need the routing number and balance well I might want to add I might want to change that to being a decimal so then I added the code here Etc normally I often have to edit the code.co pilot suggests but still it's a great start and really helps me work a lot faster another thing you can do with GitHub copile is use it to automatically generate unit test for you for example here you have a test person file so I'm simply going to write a function test person and now gets up co-pilot generates the unit test code for me like so and you see this is not complete because it doesn't finish the job so in some cases you might actually have to modify the code so in this case I don't think we should do these tests here at all because it's not good to have too many asserts in your test in fact overall it's better to just have a single assert that that's just one thing I'm just going to leave so I'm just going to put remove this and then I'm going to write another test you see it's already suggesting a test for me to test out a person string method is actually going to be correct and we're also going to test the wrapper and then I also want to test the Social Security number so now it's checking that the masking is actually done correctly and then once I have these things I can now go and run by test and it's going to run these tests for me so this is also a really easy way to get started with adding unit tests to your own code so copilot to me is really helpful for automatically completing any code that I'm currently writing but that does assume that I'm already at a state where I'm actually writing the code and what I've done until now is if I'm still thinking about the design of how to set things up or making sure that my ideas are complete that's when I often use chat GPT so as opposed to copile which is really about Auto completion shot GPT is more like a sparring partner that you can just interact with so I use tijpt a lot for architectural questions making sure I get the concepts right those kinds of things by the way if you're interested in software architecture I'm actually working on a new course on software architecture if you want to pre-register to that course for free you can go to iron dot codes Architects so that you're updated on what's Happening the links down here have also put it in the description of the video now copilot chart is not out yet but it's basically like jet GPT but right in your vs code editor which is really cool and this is a separate extension at the moment that you have to install which is called GitHub copilot chat that's the one I have installed right here and what this does is that it adds a extra icon here and if I click that then you see that now I have a separate chat window that's open here and then you can type your questions here for example I could ask it to set up a basic database model for webshop and so now you see it generates a whole database model using SQL Alchemy which is really fun and then you have some options here like you can simply copy the code you can also insert the code at the cursor so if you have a file open here I can simply click here and then let's say my cursor is here and I do this then it's simply going to insert all that code right here but there's other things you can do you can also run it directly on Terminal which wouldn't work because this is python code it's not a bash this is not a shell script or you can actually insert it into a new file then it's going to create a new file that contains that particular code and they can rename it and save it what's also nice is that you can open this session in a separate editor and then let me close this window and then you can see the chat window right here as a separate editor tab which sometimes is useful because for example here it might be hard to see what the code actually is in such a small Windows you can make it full screen and then view it that way so that's quite nice I'm not sure what model they're specifically using it is probably similar to GPT 3.5 turbo or something it's pretty fast and the results seem to be on par with GPT 3.5 but this is probably a slightly different model that's trained more on code and software development I expect so back to my chat window what's actually also nice is that the chat window knows about the currently open editor so I can ask it questions about this particular code for example I could ask copilot to turn the person class into your radio class and then you see it now has turned person into a data class it's not exactly the same because now the social security number is again a public member whereas here it's private so it's not perfect but actually this is a pretty decent starting point even remove the wrapper method because data classes already Supply that for you and then again you have the option to copy the code or insert it at the cursor there is no option unfortunately to replace the person's class by the updated personal class that would be cool if it was there so I do think in terms of the contacts there are a couple of things that they can improve but this is already very helpful and you'll see it suggests follow-up questions so for example if you're trying to understand hey what does the data class decorator actually do then you can simply click that and then it's going to run the prompt and give information about the data class decorator so the fact that it knows about the context about the currently open file is quite nice but it's still quite limited and as far as I can see it basically only knows the currently open opens and can do things without information now there's a couple of other ways in which co-pilots integrates with the vs code IDE for example if you click this then you can actually see the history of your chat sessions and then go back to a previously viewed um go back to a previous chat so that's nice also if you press shift Mount p and you go to the command palettes and then you can also type a question here and when you press enter then it's simply going to create the prompt and then answer the question for you so that's nice but other than that it doesn't really do that much with the capabilities of the editor and I think one of the nice things of the chat window being part of your IDE is that it could do way more things than a web-based interface for example it could perhaps interact with files or folders so I'm going to press this and create a new chat so what would actually be nice is if I could do something like this so I've asked it to create a basic project with poetry and request package that can then retrieve information from a free API so it is helpful in that it creates a step-by-step plan to create this project like install poetry create new directory run this install request create the file but wouldn't it be cool if copilot chart could actually interact with your IDE and do these things for you that in my opinion will be a total game because then you can let co-pilot copile chat basically interact and make modifications to your projects your file structure or your directories directly without you having to do the work many I'm sure as the tool gets better we're going to see more of these Integrations and this in particular would be really a great feature that I would love to see I'm curious though what would you like to see added as a feature to co-pilot and copilot chats let me know in the comments in any case I'm really interested in seeing how these tools will develop and what kind of capabilities they will have in a couple of months from now because this is changing and being updated really fast I hope you enjoyed this video if you did give it a like because that really helps me reach a wider audience on YouTube now if you want to get the most out of chat models like chat GPT or co-pilot chat you might want to watch this video next where I give you five tips for improving the way that you write your prompts thanks for watching and take care
Info
Channel: ArjanCodes
Views: 62,868
Rating: undefined out of 5
Keywords: github copilot, artificial intelligence, software engineering, openai chatgpt, github copilot python, github copilot chat, software development, machine learning, github copilot vscode, github ai, chatgpt coding, gpt 4 ai, chatgpt coding tips, artificial intelligence and machine learning, chatgpt 4.0, software development models, gpt 4, chatgpt 4, artificial intelligence news, github copilot tutorial, github copilot demo, github copilot review, github copilot vs chatgpt
Id: IavOJI5OV7g
Channel Id: undefined
Length: 17min 29sec (1049 seconds)
Published: Fri Jun 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.