Comparing Github Copilot vs Tabnine vs Cursor AI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey welcome back if you want to be on top of the game as a programmer you don't want to miss this video because here I'll talk about AI code assistant three of them actually the three best ones GitHub co-pilot is one tab9 and cursor I'll talk about the features of each of them the pricing what is free what is paid how popular is each of them and I'll show you how to install all them and also how to use use them and I'll also test each of them using the same example for each so you will see how they compare to each other and at the end we will discuss which one is the best for you so what is an AI code assistant anyway well an AI code assistant usually comes in in the form of a plug-in for IDE such as Visual Studio codes or pie charm Etc so it could be a plugin but it could also be a complete IDE such as cursor so GitHub copilot and tab 9 are plugins but cursor is a complete editor which means with the AI assistant embedded in the editor as an integral part of the IDE will cover each of them and regardless of whether it's a plug-in or an IDE all of them have the same role they help you to generate code from scratch they help you to autoc complete codes so if you start typing it can autoc complete that function or that line or that class they detect errors they identify code smells so the quality of your codes and they can create unit tests as well to test certain parts of your code they also can can generate comments and documentation for your code and lastly you can chat so there is usually a chat feature for these tools where you can ask questions like you do with chat GPT so you can have a conversation in that chat feature now let's start talking about GitHub pilot first so if you search on Google for GitHub pilot it should take you to this page so that's the official page of GitHub pilot but to install GitHub pilot you need to go to your IDE now GitHub currently works very well with Visual Studio code and you can also install it in pie charm but currently it's a bit limited so let's first install it on Visual Studio code so you just need to start Visual Studio code and then go to the extensions section and just search for co-pilot and there will be maybe two of of them GitHub copilot and GitHub copilot chat you don't want the chat you want the first one we can see that currently GitHub copilot has over 12 million downloads from people so this plugin has been downloaded over 12 million times on Visual Studio code and it has 3.5 stars out of five that's the rating now if you compare that to to tab 9 tab 9 has around 7 million downloads and it has higher ratings so it's been rated higher by programmers so both tab 9 and copilot you can install them as a plugin so press install now I would advise you not to install both at the same time because then you'll be confused which one you using or you can install both but you can disable one of them I'll just install GitHub copilot for now and if you go to the Explorer you open a file immediately you should see this icon added here that's a chat feature of copilot now if you start typing something nothing will happen because you haven't been sign in to copilot so you have to sign in using that and that should take you to GitHub where you need to sign in with your GitHub account so you need a GitHub account to be able to do this so I was signed in successfully now and I can now type in code so you can see now I have this message press command I or control I to ask GitHub co-pilot to do something so you have two options now on how to use copilot either you press this shortcut command I in my case and you write some human language such as create a function that converts miles to kilomet and press enter and copilot will generate that function for you and then you have the option to accept it or discard it so let's go ahead and accept it so that was one way to generate code with copilot the other way is to start typing something for example you can start by typing the name of your function so you want to give some Clues to copilot what you want to do now you may want to restart Visual Studio codes if this suggestion is not showing so the first time you install copilot you may need to restart Visual Studio code so the idea here is that you can press tab if you want to accept the suggestion made by cop pilot so I'll press Tab and that will complete my code let me try that again in another way another way to do that is to write a comment for example function that calculates the rectangle area press enter start typing diff and then copilot will suggest you the function because it knows what you have just written in the comment so I'll press tap again to autocomplete that so these are the two ways either you press control I or command I and start typing here human language or you start type code so generating code was one of the features the other feature is you may have some error in your code let's introduce an error here intentionally for example I'll just multiply this by X and then you can select the code press control I and then slash and then you have different commands so now you can fix the selected code by typing fix here and pressing enter and copilot will suggest you a fix and if you want to accept it press on accept and it will remove that issue from the code so that was how to fix some code how to explain the codes again you select the codes you press command I or control I and Slash and explain so you give the command explain press enter two times and the explanation at this time it will show here on the side on the chat area so that that's an explanation of the code you can of course just select one line and to command I or control I again and say explain so SL explain and it will do the same thing you can also test code so you can select that function and control I or command I and then slash test press enter two times and accept to accept the test so the test will be written in a separate file you see testore main was generated here so copilot use the unit test library for Python and here is a class which tests that function so test was the other feature and lastly you have the chat feature here which we introduced already somehow but basically you can ask more questions here more general questions similar to what you would ask on chat GPT like for example you can use this as a senior advisor should I use classes instead of the functions I have and you'll get a general opinion about your code so copilot is context aware it knows what codes you have so it will give you some explanation on you using classes versus functions for your particular case you can of course also modify certain code for example I'll select this press contrl I or command I and ask co-pilot to add a line or add some code not necessarily one line it could be multiple lines so add some code that stores The Returned value in a text file let's see what we'll get so we are expecting that copilot will modify the function and that's what it did so it added these two lines and I'll accept the changes so with these two lines the area value will be stored in an external text file and I can say that this code is actually correct so good job so that was about GitHub co-pilot it's a very good assistant one downside though is that it's paid it does have a 30-day free trial but after that you'll have to pay about $10 per month and that brings us to tab 9 which has a free plan so go to tab .c to see information about tab 9 you'll see down here you have a basic plan so you see the features which is quite good and to install tab 9 I would first suggest to disable GitHub compilot you don't need to uninstall it just disable it because 8 will intervene with uh tab 9 so then go to tab 9 search for tab 9 the first one is what we need install you should get this sign in tab so with this also you need to sign in to the tab n website if you don't have an account you will need to create an account first it will give you a token you will need to copy that it's quite a long token then we will need to go to the IDE command pallette in Visual Studio code you can access the the command pallette on windows with control shift p or command shift p on Mac and then start typing tab n sign in using authentication token so you want to click that press on sign in and here now in this box you need to paste that authentication token press enter and I'll got the message that I'm logged in as I did so uh we should be good to go uh let's go to main.py close this and that and let me delete everything now co-pilot is still active so I need to quit Visual Studio code and open it again so the changes take effect so let's start with how to write new code with tab n like with copilot here we also have two ways to do that similarly to compilot here we also have two ways to do that either we use natural language to ask that question and to do that with tab 9 you need to go to the tab 9 tool here on the S and then use the chat so you interact with the file with the open file through the chat with tab 9 that's currently how tab 9 works so let's say create a function that converts miles to kilomet you press enter and then the interaction is through the chat you will get an answer here but then you have the options to copy that code and paste it here or insert it directly now tab 9 also gives you some more contexts and gives you some more codes so for example how to call that function if you want to add that you press insert so let's press insert on the first one and there goes the code now if you want to insert this code as well you should be careful because the way this works is it inserts the codes in the current position of the cursor so if the position is here and you press on insert it will insert that code after the cursor you see so I'll press on contrl Z to undo that press enter two times and here I want to press insert again so that will insert the codes in that position I hope that's clear so that was one way to generate new code the second way is to start typing something give a name to the function for example Kil kilometers to miles or rectangle area you press enter so it autoc completed one line and then it will it will give you suggestions for the the other line press enter and that's it so that's how you generate new code now you might have notice that we got a header here above each function so you have options where you can generate tests for the code as we did with co-pilot you may want to explain the code document it or ask more general questions let's try the document option so I'll press that and what will happen is that you're technically sending a prompt to the chat here so oh that's a command basically SL document code so we can see that the entire code is actually documented uh so you have the option to insert the entire code in here in that case you want to delete the existing codes and press on insert or just select the entire code and press on insert so that code of the chat will overwrite the code of your file or you have the option to just select one of the functions copy and then overwrite it manually with the function you want to overwrite let's just delete everything press on insert and you have the same code but with a doc strings added so if you want to be more specific you want to write things like uh for example add some code that stores The Returned value of rectangle area in a text file press enter and now tab 9 should apply the changes only in the function we named still it gives you the entire updated code and in this case in contrast to co-pilot the solution is a bit more complex so instead of modifying the function definition what tab 9 is doing is calling that function and then storing the returned the output into a file and it's using J for that which is quite Overkill so in this aspect co-pilot is better so again you have the option to insert copy and also in this case you can show the difference between the two so that's about tab 9 as I said tab 9 is free copilot cost $10 per month so it's your choice which one you want to use both tab 9 and co-pilot can also be installed in pycharm you have to go to file settings or pie charm settings wherever your settings are and then scroll down to plugins go to Marketplace Tab and search for tab 9 and install it same goes for copilot GitHub copilot and install it now currently there might be limitations or you may added to the waiting list so the plugins might not be yet available for py charm so please keep that in mind let's now move on to cursor cursor the AI first code editor so what is cursor cursor is a code editor a fully featured code editor it's actually a fork of Visual Studio code meaning that it's technically a visual studio code plus you have a AI assistant integrated so let's install it you want to download it and then install it during the installation you may be asked to specify these options I'll just go and continue I'll go for use extensions I'm asked here if I want to send usage data to cursor or not I'll be a good citizen and press on help improve cursor and then you may be asked to log in so if you haven't signed up you need to sign up otherwise just press on login and enter your password and that's cursor so there we go I was displayed this readme.md file with some basic information about cursor feel free to close this file uh because as it's here in this project and I'll just create a main.py file so let's see how we can ask cursor to create new code for us so if you click somewhere here in the open file you'll see these two commands command l or contrl l to chat or command K or control K to generate so we want to generate code so I'll press on command k and I'll give the code instructions create a function that converts miles to kilm press enter and there we go now we have the option to accept reject or give followup instructions I'll just accept it now see the difference here uh between cursor and co-pilot and tab 9 the difference one difference is that we got a function with documentation already generated for that function so that's quite good it follows good practices good programming practices so in this aspect I would say cursor is better than tab 9 and co-pilot we'll talk at the end of the video which is the best choice as a conclusion so let's continue so that's how to generate code the second way to generate code with cursor is this but first you want to make sure that tab n is disabled so tab 9 was automatically installed as an extension so you want to go to extensions you can press this Arrow to expand this area and go to extensions and you want to search for tab 9 go to tab 9 and you want to disable tab 9 and reload cursor now uh let's try to see how we can add or create new codes and to do that you don't type in here like we did with co-pilot and tab 9 but again you press command K or control K and you can just write the name of the function there such as Define kilometers to miles and press enter and cursor will add that function for you and press on accept so there we go now let's add some code to this function to do that you want to select the code and then you want to press command K or control K and you want to say add some code that stores The Returned value in a text file press enter and there we go uh so we have the changes applied here now with red you will see the lines which were removed and in green you see the new changes so basically the third line was removed and three new lines were added and then return miles again so you can accept or add more instructions let's accepted and there we go so it seems to me that cursor did a better job here and the the interface to add some code was more intuitive so so far cursor is doing better than tab9 or co-pilot next let's see how to generate tests let's generate a test for this code so you want to select the code and then you want to use the ad to chat feature but before you do that we want to store the test in a new file so in that case we want to create a new file so I'll go ahead and say mainor tests.py right so we have a new file you can close that new file and then select the code add to chat the code will be added to the chat area here and underneath you can ask a question now the question will be this create a test for this code and store the tests in and then you use at so with that symbol you can reference files folders code also such as kilometers to miles but in this case we want to reference mainor tests. py right you see now we are tagging that file so create a test for this code and store the test in Main test.py prenter and down here we'll see that this code is being generated for mainor test.py so you have the options to copy the code or apply the diff I'll press on apply diff apply to entire file and in main that uh underscore test we will have the test written here and we have the option to accept it so there we go that's a test the original file stays the same and so on if you want to add more code remember you can use control K or command K and say for example call the two functions above or you can be more specific and say call and you can tag those functions right miles to kilm and kilomet to Miles and press on generate and accept and that's the code which calls those two functions so that brings us to the end of this video and to conclude it let's talk about which of these three tools you should choose so we have copilot we have tab 9 and and we have cursor now the decision depends on what IDE you are currently using so are you using visual studio codes for development or are you using pie charm so if you are currently using visual studio code then it makes sense to just switch to cursor because it's the same IDE but with cursor natively implemented so you have everything out of the box and you can still enjoy all the features of Visual Studio code but if you are using another IDE such as pie charm then you might not want to switch to a completely new IDE such as cursor uh but you may want to choose between tab 9 and co-pilot so to use either tab 9 or co-pilot as a plugin in pie charm and which one you should choose depends on whether you want to pay or not so if you're ready to pay $10 I think co-pilot is better it's more popular it's more accurate and it has greater support by the community uh but if money is an issue then you want to go with T9 so I hope that's cleared to help you which of these tools you should use thanks a lot for following this video and I'll see you in the next videos thanks oh
Info
Channel: AI Tube
Views: 1,441
Rating: undefined out of 5
Keywords: Comparing Github Copilot vs Tabnine vs Cursor AI, copilot, github, github copilot, Cursor AI, Tabnine, Github Copilot, github copilot vs tabnine, github copilot chat, github copilot vs amazon codewhisperer for java developers, github copilot for deep learning, github copilot vscode, github copilot tutorial, github copilot explained, cursor, github copilot chat vscode, copilot github, github copilot review, copilot github ai, is github copilot worth it, github copilot typescript
Id: JbH9usJzVIA
Channel Id: undefined
Length: 28min 1sec (1681 seconds)
Published: Sun Mar 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.