GitHub Copilot ๐Ÿค– The future of software development?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
github co-pilot is an ai pair programmer that doesn't spill food all over your keyboard or licks your mouse when you're not there yeah that could be a thing today i'm gonna put it through its paces and see if it delivers what they promise in short it's pretty impressive but they also have a few concerns let's dive in what the if you're new here you want to become a better software developer gain a deeper understanding of programming in general start now by subscribing and hitting the bell so you don't miss anything last month github introduced copilot they call it an ai pair programmer that helps you write code faster and with less work i like that because i'm a lazy bastard it's available as an extension to vs code you can go to the extension section in vs code and then you can install it there after installing you still need to authorize a dope because you need to be part of the technical preview in order to use it i'll put a link in the description below that you can click on if you want to join the wait list you'll see it in a minute but using this is pretty straightforward when you type in your code editor it simply automatically suggests code if you want to add that to your own code you press tab and then it gets inserted it integrates really well with vs code it does its job and then it doesn't get in the way you can really see that they thought about this so let's try a few things first thing i'm going to try is the basic example that co-pilot actually gives us that we can play around with i'm going to create a function to compute the number of days between dates now you see that copilot is already suggesting something to us actually using this is pretty straightforward if i just want to accept this suggestion that it just made i just press tab and then i have to code now there's some issues because obviously i didn't import date time or anything and pylance is actually complaining about missing types but in principle if you look at the code this this looks fine let me delete this and let's look at a few other options so here's one option but you can press on mac option and then the square brackets to navigate between options and on windows machines it's or linux it's out so let's see so you see we get a few different versions of this that we can try if this is not enough you can press ctrl enter and then it's going to create a number of different solutions for you that you can choose from so let's see well that's except this one and then it puts it in here let's try another one i'm going to add a function to compute the moving average and that's going to need a well that's actually what it's going to need this needs a value and a window so you see that just from the name of the function it determines what it needs in this case list of values and the window and then it simply generates the code for you just like that i think that's pretty incredible let's try this again and see what kinds of different options we have there's this one this is a much shorter one that uses i guess numpy and then we have a few other ones that we can choose from so let's change this to something slightly different say we're going to compute the exponential moving average if you're in trading you probably know what this kind of stuff is ah there we are so now it computes an exponential moving average and looking at the code that looks fine to me there's a few more other options whoa what's this okay what else do we have okay this makes more sense yeah yeah yeah i do like this one actually so you see in some cases it breaks down now let's try something a little bit more complicated let's create a class employee and see what it comes up with so first suggestion is some kind of initializer makes sense let's see what else do we have okay a couple of methods that might be useful so let's go with this one so sometimes it also generates code that doesn't compile for example here for determining what the email address is there is some stuff missing so it's not complete now let's try something else and see if it can deal with that as well i'm going to turn employee into a data class i'll remove this originally suggested code i'm going to add a data class decorator here and then let's see what it's suggesting to me now so now i get attributes that make sense in a data class setting so let's go for name and id sounds good and what you can do now is add more so oh it's suggested department job title manager that's another employee who you report to your email phone im extension physical address postal address other pager pager are people still using that fax okay why not welcome to the 90s title car license man employers really need a lot of information about you as an employee employee number business unit job code so it's basically generating all these attributes for you that might or might not be useful and at some points it will start to break up and you'll see that will happen now because now it lets you define a job category now there's a subcategory but if you go on it just continues creating subcategories sometimes the algorithm just runs out of new suggestions to give to you and then this is what happens let's look at something a bit different now a while ago i did a video about the factory design pattern and it had a video exporter class with subclasses of varying quality levels it had an audio exporter class also with specific subclasses and there's factory that can create video and audio exporters for you and i made a few like fast exporter high quality exporter master quality exporter and let's see what happens if we add another class here let's call let's try a low quality exporter what the so it just generated the entire class include and it actually makes sense because it's it used the lower quality video export and the lower quality audio export for this low quality exporter let's try an extreme quality and see what it does then oh my god this is incredible on some level it actually seems to understand what the context is of the thing that you're trying to create i'm impressed now let's try some other stuff what happens if i type this ah okay that's it not bad and how about this one close that okay so i just got a few connection strings here let me try another one okay not bad not bad not bad and how about this oh what's this uh here's you'll see an example of where it just starts to break down and these are the only two options others yeah so i'm i'm not sure it's so it generates a bunch of keys here i'm i'm not sure these are actually valid i i guess they're they're not valid they're just kind of mixed up from other api keys that happen to be in the repositories which still feels kind of dangerous though let's try one more thing yeah so here we got kind of the same thing yeah so they definitely put some time into making sure that you're not getting random private keys from other people or something overall i'm quite impressed i found co-pilot quite useful in suggesting solutions to common software problems and i can imagine that as the tool gets better this is going to save developers quite a lot of time this is not going to put you out of a job or make my channel obsolete you still need to think about the structure of your software and how to organize everything i wrote a guide to help you with this you can get it for free at ariancodes.com design guides it describes the seven steps that i take when i design a new software application or a new feature and perhaps it helps you structure your thoughts as well so ioncodes.com design guide now i have a few concerns about github co-pilot the first concern is a legal concern others have mentioned this as well i'm not a legal expert so i won't spend too much time here but github trained the model on publicly available code in github so they're allowed to do that under their own terms and conditions the issue is that a lot of that code is under a copy left license that means that if you want to use that code you need to attribute the original owner and release it under the same conditions and that often doesn't make it suitable for commercial use so what happens when github suggests a copy of that code to you via copilot can you then use it commercially i don't know some people have called this open source software laundering for commercial use now github says that they mostly generate original code in about 0.1 percent of the cases according to their own research it's actually a copy of existing code but if it's being used by millions of developers then 0.1 percent is still a lot and there have been several examples online of code that was clearly copied even containing some of the comments in the original code so in the end i think when you use system like copy you have to be careful when you see code that looks like it's clearly copied perhaps you shouldn't use it now second concern i have is a quality concern copilot is based on code that's in public github repositories now not all of those report stories contain high quality code in general i'd say the code quality is average in repositories on github if developers simply accept these code suggestions and not check whether it's good quality code or whether the code is actually doing what it's supposed to do then that can lead to a spiral of decreasing code quality because the generated code is committed again and perhaps is used again by the algorithm to suggest it to others it's a bit similar to what's happening on social networks where people start living in certain bubbles of misinformation so similar thing can happen here and that's really concerning to me of course on some level this also happens on stack overflow where people are just copy-pasting code without really checking what it does but at least there is still some community aspect to it that checks whether the answers are for high quality with co-pilots you're basically on your own it's also not clear to me how co-pilot deals with quality does it have quality metrics that integrate with it that check which code is of high quality and which isn't perhaps it uses the suggestions that you choose when you use copilot to suggest those things also to other developers but even that doesn't necessarily solve this spiral of decrease in code quality that i mentioned before and then there are potential security concerns now lots of report stories still contain sensitive information like database credentials api keys and secrets passwords and so on github trained this on public repository so it should be less of a problem and if it's in there then it's already compromised but perhaps in the future github is going to expand how they train the model by also looking at private repositories we don't know that they're allowed to do that under their terms and conditions it just shows that it's really important that if you have sensitive information like database credentials etc don't put them in your repository put them in environment variables and set those environment variables when you deploy your surface and another thing that i was thinking about is it possible that a bad actor of some sort finds a loophole in the copilot algorithm and is able to commit a certain type of code that the algorithm then starts suggesting to other developers this opens up a whole new avenue for hackers to get into places where they're not supposed to be maybe this is all just academic and it's not going to be an issue but given what happened in the past i'm not so sure overall this is an interesting new direction for software development i'm not going to uninstall it yet but play around with it a bit more see how it feels when i use this for a longer period of time do you see yourself using copinet as part of your development process would you pay for it let me know what your thoughts are in the comments that's it for today thanks for watching take care and see you next time [Music]
Info
Channel: ArjanCodes
Views: 15,953
Rating: 4.9528794 out of 5
Keywords: github copilot, vs code, github ai, ai programming, github pilot, copilot ai, github copilot python, copilot github, github copilot tutorial, ai development, artificial intelligence, developer ai, copilot github python, ai code completion, ai code, copilot github test, copilot github installation, copilot github tutorial, copilot github demo, ai code python, ai code completion vscode, ai code completion github, github copilot vscode install, Github copilot review
Id: FS_jj7Joj1w
Channel Id: undefined
Length: 13min 58sec (838 seconds)
Published: Fri Jul 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.