First Look at GitHub Copilot and What It Means For Developers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to this episode of dev questions with tim corey join us as we tackle the questions you are asking about a career in software development understanding the industry and new technology now here's your host expert developer and online educator tim corey let's take a first look at github co-pilot and what it means for us as developers now in the past week i have heard from a lot of people asking the question what is this new technology is it going to take over the world is it going to replace my job what's the good the bad the ugly so i thought a great opportunity to talk about this specifically github co-pilot this new project that just came out but also in general what ai means for developers and is it coming for our job now this episode of dead questions be a little bit different normally it's just me talking on the screen if you're watching on youtube if you're listening on a podcast it's just me talking in your ear but i am going to show off the github co-pilot site so i'll swap to a video in video type format if you're listening the podcast don't worry you're not being missing any context here i will talk through what i'm when pointing out on the site but if you want more information you can go to copilot.github.com to get that information or if you want to go watch this episode on youtube that's fine as well but you're not missing anything if you're just listening on the podcast so let's let's talk through what this is all about github just recently launched a new uh limited preview release of a product called github copilot and the idea behind copilot is they're saying it's an ai pair programmer to work with you so it's artificial intelligence it's going to sit next to you and say hey how about you do this hey how about you add this code and the the promise of this is really cool but it's not exactly what people think it is so let's talk through these claims what's true and what's marketing speak what is going to be beneficial what's going to be detrimental possibly and what is just not something to worry about so let's start off right away with those two little letters at the very top ai ai stands for artificial intelligence i can tell you that there's a broad range of what people think artificial intelligence is some people might think of artificial intelligence they think to the star trek the next generation where they had an android called data and he was a you know close to human as possible he made his own decisions he was inscrutable at times he sacrificed himself other times he was basically human this is not what this intends to be or is going to be this will not be that type of artificial intelligence github co-pilot will not pass the turing test meaning it will not impersonate a human really in my mind this isn't even artificial intelligence artificial intelligence is it makes decisions it makes choices and really this at its heart is not making decisions now you can argue me well it's kind of making an if then kind of comparison to me this fits more in the machine learning category so what this is it's very hard is they have looked at the public repositories for open source code they scanned them and they said hey you know what there's some patterns here and with a big enough computer brain you can look at billions of lines of code and say i see similarities and they look at those similarities that okay i have learned from this that you know there's an easy way to or there's you know three different ways that people check for let's just say use a very simple example null we check for null in this way this way or this way you know we say is no we say is not null we say you know um equals not null or equals you know empty object or something like that so there's different ways of doing it and so it looked at those things in the public repositories and then when you say in your code hey i need an is null check it goes i know how to do those let me give you someone else's code essentially and that's what this really is at its heart it's just giving you someone else's code and not even necessarily their full code in fact we'll see in a minute that they don't even say that's going to work all right but the idea is that this is going to make suggestions for you let's take a quick example here right after the very um the first part of their page they're showing off sentiments.ts where they we do a replay here what the program writes in comments is hey i want to determine if the sentiment of this text is positive using a web service they written comments and then the they write the the opening signature for their method and then the ai or the ml or what i'll call it github copa says i know how to check for sentiment analysis using a web api so it writes out all the code for doing that sentiment analysis getting all the way down to the end where they've asked for a boolean which would be true or false positive or negative because they're asking for is positive and it returns back hey if it's positive then return true otherwise return false so it wrote uh you know nine lines of code based upon a common pattern developers do well you may not have known that pattern you may not be familiar with the web service you may be familiar with all the things that you do a check for um asynchronous code and all the rest it did it for you and that's pretty cool so there is a really big positive here um what i want you to take from this this overall talk is there's positives and negatives here don't only listen to one of them listen to both sides here so the positive here is that it is a pair programmer it is sitting next to you and saying hey others have done it this way now again this is not artificial intelligence as much as it as it is machine learning where they had gone out and learned what other developers have done and are suggesting hey do you want to do this as well a simplified version of this would be we're taught to use class libraries we say let's write the code once and then reuse it the principle of dry don't repeat yourself write the code in a method and then call that method multiple times well this is just an expansion of that where we use other people's code as well and don't repeat the work of basically reinventing the wheel when someone has done it well once or in this case probably hundreds of times then why are we doing that same exact code instead of just finding it somewhere the um the example of how we do this right now is you go to stack overflow and you search for your question you find people have answered that question and the suggested answer you go yeah that looks good you copy and paste it i mean the april fool's joke this year for stack overflow was a new keyboard for stack overflow that was just go stack overflow ctrl c ctrl v that was it you know like just copy and paste that's all you need well you know that is humorous but in a way that's kind of true why would i rewrite code that already works so this is just pulling that code in from other places now some of this looks great and it could be feature complete 100 but it's not always going to be that way so the the idea behind this is really positive you're bringing in the things you're already doing you are re you're not reinventing the wheel which is developers we shouldn't be so that's the positive of it the negative of it is this is not going to write code this is not a code generation this is not something where it's going to say okay i've never seen this before but i'm guessing we're going to do this and write methods for you it's going to look at what's already been done when you're thinking about programming a lot of the stuff you've already done we're going to do again whether it's in a new language or whether it's just for a new application data access is data access talking to a sql server is gonna look kind of the same through every different project if you use the same like you use dapper or use an entity framework or if you use you know whatever data access system you use it's gonna look kind of the same from project to project to project but things are gonna change there's a few environmental things that will change and this will help with that you'll try and infer some things but um the actual kind of the bare bones of it is gonna be the same so that's the positive of it bringing in and helping us not reinvent the wheel it's not quite copy from stack overflow but it's kind of that idea all right so let's you know talk about what the other things of us are right now this isn't public i'm sorry private preview um it's not something you get right now you have to sign up you know wait list so i don't have it installed but eventually it's going to be in visual studio code yes code not visual studio vs code and it's going to use um they say whatever language you love because it's gonna search you know the web right now they have not listed c sharp but i am pretty certain they're gonna have c sharp pretty early on because microsoft owns github and microsoft's language is c sharp um or one of the languages is c sharp so i would assume that it will be in there pretty soon okay but primarily the first things coming out of it are javascript uh python ruby typescript those type of things okay so yes it's more than autocomplete they kind of talk about that but it really kind of is this idea of you give it the the broad strokes of what you want and then it goes and fills out what it thinks you need but here's the kicker here's one of the things that people are going to miss in this you need to understand the code that it writes so if it writes this code that you see right here on screen or any code and you go i don't know what that's doing you really can't put that in your code in your program just like if you go stack overflow and you find code that works but you're not sure what it does you really shouldn't put that in your program because when you put things in your program you don't understand and they break it's like magic the magic stops working you're up a creek what do you do there's nothing you can do so you really need to understand what it's doing all right again it's talking about skipping the documentation and searching for examples this has examples it's really just bringing examples in it's already searched and found which is very convenient very positive from that perspective but it still is just search the web find examples all right um now one of the things that i you know brain testing that's pretty awesome it helps you write your tests that's pretty cool one of the things i heard um one on i saw a tweet somewhere where one person said hey you know what this is gonna kind of replace the coding interview and that was actually one of the first demonstrations they used internally for github copilot is they took the github two hour uh coding assessment that they do for developers and they ran github co-pilot through it and it completed the entire assessment in about five minutes using tab tab tab tab um that's pretty awesome that's really cool stuff and it does kind of highlight how silly some of those coding interviews are because yeah if you have access to the web where you can look these things up or if you just have a library you can just bring in why are you reinventing the wheel here but on the other hand it does show off that you can write code but as these tools get better it's getting harder and harder to accurately assess a programmer because well 10 people could tab through in five minutes answer correctly that two-hour interview question probably nine people in that ten people won't understand what the code does and that's a problem so it is gonna be harder to understand who's a good programmer who's not not because there's an elitist thing here because again you don't want to operate on magic so i wouldn't say because i had github co-pilot i don't need to do that two hour programming test i would still say that's probably a pretty good test hopefully um because it is going to evaluate how you write code not how the ai writes code so even if that would allow access to the web but then on half i would make sure that they prove you know why you do that what's this line all about what does this do so that if you go i'm not sure that line does then you don't understand your own code that's a problem so i see that's where coding interviews can still have a place but these tools will make it easier um as a real or as a developer as doing the actual job again if you understand the code so there's some cool things here i do want to point out they have some um some quotes here and i want to point out some good and some bad around these quotes i think it highlights some of the assumptions about ai programming or ml programming or how you want to talk about this idea so this first one in that i'm going to show from harry edwards says trying to code in an unfamiliar language by googling everything is like navigating a foreign country with just a phrase book using github co-pilot is like hiring an interpreter i don't feel real good with that comment and the reason why is what i've already talked about the idea that if you don't know why it's doing that that's concerning to me on the other hand if you know as a developer you understand logic and so switching between languages is a lot easier it's just about syntax so if it's just helping you with okay the syntax for an if statement uses curly braces or uses double parens or whatever it does that's different so if it's about the syntax and knowing you know what spacing to use you use commas or semicolons or however you do things in that language what what keywords to use that's definitely okay because helping you with the the awkward stuff that's just not that important the important part is the logic but if you don't understand the logic of it if you don't understand what the code is doing even after writing it yes it may work and you'll be able to get the job done but that doesn't mean you understand how it works if it breaks and so the danger here is going to be that let's just say you're a a intro programmer you're a junior level developer you just get hired and they say hey i want you to use github co-pilot to work with you in building your code cool you got a great tool to help you write better code and you say okay i need to check for an email address and validate that it is an email address that's actually one of the examples they have here it writes this really complicated uh regular expression which has got all the you know crazy stuff in there that's great because that regular expression is messy and it's hard but how do you know it's actually going to work correctly how do you know what it does how do you know if a email a valid email address gets rejected by it how do you know to fix it you don't but the problem is as a junior developer if you get code to work then because the fast-paced environment of of you know employment you may be pushed onto the next project hey it's working great let's move on and it passes all the tests you can think of going into production so cool it's working but you have no clue what your own code does that's scary okay so that's my fear is going to either enable people who shouldn't be doing this to do it or it will enable abuse where you're pushed you're forced into not understanding your own code just move on move on move on it works and that can push you in a really bad spot okay so that's one quote i want to point out um the upper right hand here uh gunica it surprised me how precisely i understood my comment and generated accurate suggestions the ability to choose from 10 different suggestions was the cherry on top and yes that is amazing again you have 10 suggestions to pull from though how do you know which one is right how do you know which one does the thing you're looking for if you don't understand the code that's a problem if you do understand the code that's awesome so definitely some positives and some negatives here so this big quote here in the first day github co-pilot already taught me about the nuance in javascript object comparison is comfortable that is as comfortable with our database schema as i am this is the single most mind-blowing application of ml i've ever seen i love that mike pointed out that's ml that's doing this it's machine learning it's it's the idea of it scanned other code bases the teaching the nuance of javascript that can be really helpful because it's going to suggest things that you're not familiar with and if you look at that and go why it do that you can easily google that and go what is this you know in string and in str thing or what is this you know whatever it does and go i didn't know that existed but now i do and i know how to put it in code that's really cool as long as it's teaching you as in you're learning what it's doing okay um so there's other things down here um the thing i really like kate points out um case says github co-pilot discovered the test i was working on or discovered that a test file i was working on was missing a specific test and suggested and wrote the test for me that's awesome the idea that we can use this in unit testing and it says hey you know what you're missing this edge case you're missing this uh potential bug and let's write a test for it and make sure that the test will fail and then pass that's really cool stuff i think for me that's where i am the most excited the idea we can we can create a test file and say hey i want you to test this method it's that's where for me the pair programmer really becomes true because a para programmer will point out things that are blind spots to you the assumptions that you have that maybe aren't true you know that email address example i would love to see it write the tests for that email method as well where it would say okay let's try the standard email address where it's you know tim at iamtimcorey.com where you have the you know the normal parts of an email address then let's do things like um dot co so team i am tim corey dot that's still a valid domain or you know a longer extension or different extensions or you know single letters there's a lot of different possibilities you can do um first name dot last name at and and so on so having that error programmer say you missed an edge case is really cool i hope that's one of the things that really comes out of this so um this is a pretty cool project it's kind of the the next generation or even a sister generation probably next generation of what intellicode does now in visual studio we already have this intel code has already scanned other repositories and has found these are the things you're probably looking for and it helps you know complete whole sections of your code little sections not as big as this so we already have this this kind of next step or in that um the idea of the ml scanning of the web and learning how coders write code and moving on from there there is down here um i believe yes how good is github copy i want to point this out they benchmarked against a set of python functions that have good test coverage and open source repositories they blanked out all the function bodies and asked github copa to fill them in the model got this right 43 of the time on the first try and 50 57 of time when allowed 10 attempts that kind of gives you a a good idea of where it's at so it already has a good set of tests and it has now the method names to make those tests work so it's got a lot of information to pull from and then they say go and it gets it right 43 of the time and after 10 attempts getting at 57 of the time well it seems like that's better tried 10 times and yes it's a learning algorithm that's going to get better over time but that's still getting it right half the time this is why i'm stressing the fact that you need to understand what it's doing or trying to do because if it's okay in the code right even 57 percent of the time that means the code puts in is wrong at least 43 of the time think about that the code that suggested can be wrong and so it may feel like it's right it may look like it's right it may even run somewhat but it may be wrong so this is why i stress so much that you are the developer you're in charge you're the one that needs to understand the code you're the willingness to sign off in the code you're the one need to fix the code when it breaks so this is an amazing looking tool now this is early preview this is just coming out but it's going to be i think a really good tool to use italy one that i will install in my vs code i will try now i will probably use it pretty much all the time that doesn't mean it's replacing me okay and so that's one of the questions i'm getting a lot is hey is it going to be in five years we don't need developers no no it's not um even if this were to get to 100 percent this does not mean it's not going to get 100 no tool ever does um no programmer ever does either even if it got to 100 percent effective at doing its predictive methods this does not mean they will ever replace developers first of all this is a learning system what does it learn from developers but it learns the code that developers wrote so in fact if you were to turn this loose right now it would actually make itself dumber over time because if it writes code that you just check in and say yep cool yeah co-pilot wrote it awesome and checking your repository it's going to use that code to help train itself how to do it better in the future but it's learning from its own mistakes and so it's going to reinforce those mistakes which means it's going to get dumber and dumber and dumber over time it needs developers to go know us as bad code let's fix it and then it learns oh this is better code for that this is more used code for that i gonna get better over time that takes developers okay so that's one thing it's got to have developers to learn from they cannot learn on its own this is not artificial intelligence in the fact that it's a self-generating machine it's not going to self-learn these things it's going to take developers teaching it everything right so that's one thing about it's not taking a very job another is that this this tool is just the next step in the evolution of development back we first had computers where they were just raw ones and zero machines this is before my time but originally we programmed computers we being developers in general not me um with ones and zeros with teaching it in binary we learn assembly language we talk assembly language that's really confusing and really dense and hard to understand and so over time we have built up languages that did some of the work for us as a if you're a c-sharp developer you have.net and net does a lot of stuff for you you want a console window you just say console application that's just a console application gives you a console window you want to write to you say console.writeline there is code behind that a different developer you've never met probably wrote that is built upon a whole framework of code that developers wrote that you've probably never met and yet you put it in your production-ready code and it's fine because they wrote the code they understood it they tested it they made sure it worked right and then you build on top of that and some people say well that's not real development real development is i had one this past week or two where a person said you know net developers aren't real developers because they're using all these tools when a real developer uses c or c plus c or c plus plus is still abstraction over ones and zeros over assembly so there's always going to be this next level up of making our lives easier and we want to embrace that because yes it may feel like oh they're taking my job although they're making you know changing how i do things and i don't like that um i get that change is hard but at some point we have to stop saying let's build wheels and start saying let's use wheels that have been built for us and that's what this is we're building on top of the shoulders of giants we're building on top of what other people have gone before and done so this is going to continual improvement of development so this is kind of like we're seeing an evolutionary step it's a small one it's not nearly as big as you think it is but it is a small evolutionary step closer to the idea of us not having to do much work but i tell you what they're never going to replace programmers even here you see that you have to tell it what you want okay i want a sentiment analysis that uses a web service that's not a lot but it gives the necessary information for the ai to find potential suggestions because at the end of the day the job of a developer is writing logic it's not about the code it's not about the syntax it's not about the language it's about writing the logic or identifying the steps necessary to get from point a to point b whatever that is for your specific situation so this is going to help you with a syntax this is going to help you with developing the micro bits of logic where your job is going to be to have the overall the bigger piece of the logic putting the building blocks together this just makes the building blocks easier so don't be afraid for your job don't be afraid that this is going to take over development jobs this is not this is not skynet this is not ai that's going to you know revolutionize the industry we've already had this for years it's just making it a little easier there was a tool back in i believe it was visual studio 2013 maybe even earlier that it's been a while so it's it's been a while since i've used it there's a tool where you would um type there's a plugin something like that where you would type in a question and it would bring in the code directly from stack overflow answers to that question you know um how do i check for an email address in c sharp and it would pop in your code the accepted answer the code of it they go yep that looks good and away you go that's kind of what this is doing only in a much grander scale a much uh more in-depth and that kind of thing we've had this kind of stuff for years we still have jobs there's still a need for developers um a great increasing need for developers so this is not going to take your job okay this is not true ai this is not going to learn on its own so but this is going to be an interesting tool something to keep our eye on just don't get caught up in the hype and believe that's more than it is this will be a nice supporting tool this is not a massive thing this is a nice supporting tool with great marketing that's what it is okay so definitely i'm positive towards it i'm positive towards the fact that it's going to be able to help people and help developers and make our lives a little easier but i am not going to get caught in the hype train of thinking it's more than it is or in thinking it's going to replace what i do or make my job um somehow redundant okay so that's my thoughts on github co-pilot thanks for listening to this week's episode it's a little bit different episode but this week's episode of dev questions if you have a question about uh development the first place i'd recommend you check out is the archive because the archive has a lot of questions i think this is question number 58 or so that i have answered about developers questions so check out either on youtube there's a whole playlist for dev questions or go to i am tim cory and check out the podcast which are also itunes and spotify pretty much wherever you listen to your podcast if you don't find the question that you're looking for go ahead and either leave a comment on the youtube channel or um on i am tim corey the podcast page is a form to fill out to ask your question i'll try to get to it if um it's a question i think will and will be helpful to as many developers as possible but either way i will at least evaluate it and think through how we can possibly work this in somewhere all right thanks for listening have a great day as always i am tim corey [Music] you
Info
Channel: IAmTimCorey
Views: 20,808
Rating: undefined out of 5
Keywords: c#, c# developer questions, dev questions, dev questions series, developer questions, how do i, iamtimcorey, learn c#, tim corey, github copilot, ai programming, machine learning, vs code, ai development, github ai, github copilot vscode, ai code completion, openai codex, github copilot review, artificial intelligence
Id: vFAwoMD06Sg
Channel Id: undefined
Length: 35min 13sec (2113 seconds)
Published: Thu Jul 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.