Exclusive First Look at GitHub Copilot - All you need to know

JavaScript Mastery · Beginner ·🌐 Frontend Engineering ·4y ago

Key Takeaways

This video introduces GitHub Copilot, an artificial intelligence tool that assists with coding using auto-complete features

Full Transcript

hi there and welcome to another javascript mastery video github co-pilot artificial intelligence that will take your job i'm sure you've heard about it or at least seen its robotic face yep that little guy will presumably take her job in the future will that really happen or is microsoft just really good at marketing this very advanced form of autocomplete well here at javascript mastery we've got an access to the early beta to github co-pilot so that you can find out yourself we're not just gonna talk about it like most other youtube channels do we are going to put it to the test with pure javascript and then we're going to go a step further by testing its knowledge on html react and even node if you enjoy watching our videos definitely make sure to subscribe and smash that like button let's get [Music] started before we dive into the code let's just quickly explain what github co-pilot actually is it's a visual studio code extension that auto suggests whole lines of code or entire functions based on how you code and what you're working on it's basically a very advanced form of autocomplete you describe what you want to do in a comment and then co-pilot attempts to predict exactly what you want to do let me repeat that you write a comment saying what you want your code to do and it writes it for you kinda scary right copilot generates code recommendations using openai's codex an artificial intelligence model based on gpt3 gpt3 is the smartest neural network machine learning model in existence the codex was trained on billions of lines of open source code from github which allowed the model to learn common code patterns unlike basic autocomplete copilot is capable of creating new output from the code it's learned it's actually writing new never-before-seen code artificial intelligence was there to worry about right well for now enough talking let's see how it actually works to test it out i'm going to create a new folder on my desktop and let's call it something like copilot underscore test i've also opened empty visual studio code window and we can simply drag and drop our folder in there once we're here i'm going to make this a bit bigger zoom it in so that you can see everything well and i'm going to show you what we're actually using so if i go to extensions and type copilot you should be able to see that there is github copilot extension if you've gotten access to the early beta then you simply need to download this enter the code and everything is going to work automatically if you're interested in testing this out yourself i'm going to leave the link to the early beta down below if you appreciate that definitely make sure to smash that like button and leave a comment now let's test it out first let's test it out on a pure javascript file i'm going to create a new file and i'm going to call it index.js let's try with some small random functions something like return a random element from an array should do the trick i'm going to press ctrl enter that's going to give me 10 different solutions i can choose from and right away we get function random element but let's see if we can maybe find something more concise there we go function random element which takes in an array and then returns a random element from that array let's accept this solution in this example we don't need to export it so i'm simply going to remove that great copilot successfully created our first function now let's say that we are lazy enough and we don't want to write our own arrays so we want to create an array containing random numbers between 0 and 800. let's see if the compilot can do that it automatically suggested the array name and then it actually created a for loop which we can call and as you can see this for loop inserts the numbers from 0 to 100 into this numbers array now let's say that we want to print the array so let's say print the array and automatically it is printed out and finally let's say that we want to print a random element from an array that's exactly what i wanted to do and github copilot even created that comment for me and it's going to autofill it as you can see it knew that the random element function existed and that it takes in an array as a parameter therefore it automatically pushed our newly created numbers array that seems great but is this code actually working let's test it out i open my terminal and i'm going to simply run node index.js and there we go it printed an array of 100 elements containing random numbers from 0 to 100 and it printed out number 94. right now it's hard to see if 94 is actually in there so let's decrease this to only 10 random elements and let's rerun the code as you can see 21 34 and there we go it actually picked the random 34 number from the array that means that our kind of trivial code actually works this is not all that complicated but the fact that github copilot knew exactly which code to write to make these comments work is kinda extraordinary so we're going to give our compilot a pass on this test now let's test it on a tougher one let's say that we want to search for tweets containing a certain phrase and also we want to like them using the twitter api client and i'm going to press enter and see if it's actually going to autofill it for now i don't see anything but i'm going to press ctrl enter and see if there is a solution we want among these 10 solutions the first one already seems great it is requiring something from the tweet library and it's setting up a client and it seems like it already knows what this library needs consumer keys secrets and access tokens it also suggested a random phrase we want to search for and it seems to be making a get request so this seems good enough for me let's accept the solution as you can see this was quite longer than our previous functions it seems to be importing a library setting the client setting the phrase and then making a get request to search for tweets with that specific phrase then it goes over the tweets sets the like count to zero and then for each tweet that is not currently like it increments the like count we also have some nice cons of logs and finally the post request is the thing that actually adds it to the favorites or likes it so we don't actually know if this piece of code works or not but the logic seems all right one thing to mention is that we told him to use the twitter api client but for some reason it decided to use this library instead we're not going to test the functionality of this code but it seemed to do this task quite well but this medium-sized task was done quite well so co-pilot has a pass from me here as well and finally i have one last test which is a funny example let's say that we want to find the answer to the ultimate question of life the universe and everything and of course we also want to write it to the console so does this ai know the ultimate question of life let's find out i'm going to press ctrl enter and as you can see the answer in most cases is just 42. we have a function main with the answer of 42 and we simply can't log it this was just a joke from the popular sci-fi movie where the ultra smart artificial intelligence was asked to answer the ultimate question of life universe and everything of course it was much smarter than humans are so it gave the answer 42 which of course the humans is meaningless but to it maybe it means something and apparently github co-pilot also knows the answer which was funny enough for me to include it in the video but for now we've been only warming up everybody knows pure javascript right let's test copilot's knowledge on react i'm going to create a new file called app.jsx and then inside of there let's try some react things we can say import react from react just so it knows what we're doing and let's try telling our co-pilot to create a functional component that should be a pretty easy task to do and immediately it suggested export default function app and let's see if it's going to continue autofilling it there we go although really simple this code would actually work and render inside of the browser now let's try to up the game a bit let's try functional react component that uses the use effect hook and it even suggested something more than we wanted it to do we can also cycle through the answers to perform async actions let's try with that export default function app and i'm going to press the ctrl enter to get more solutions there we go the first solution is actually the right one we have the used effect and then we're calling the dot then and one more time that then to get the events and these seem like github events so it randomly chose the api we want to fetch the data from now i can already see that this code will not run take a few seconds think about it and try seeing where the issue is the problem is that we are never importing use effect so we either have to import it from the top or we have to say react dot use effect this was just one small issue that somebody will immediately understand but it nicely shows that co-pilot cannot be used by beginners to write the code for them they have to do it with a bit of help from the co-pilot and for the last example we are going to create a functional component so const component is equal to a functional component like this and we're going to ask the copilot to do something inside of it for example create a use state hook with values of number and set number and it actually did it now let's use those states by saying create a use effect hook that increments the number every 500 milliseconds so this is a bit tougher right now and there we go one more time react use effect and it used the set interval with 500 milliseconds to increment our number as you can see it forgot about the dependency array but if we add a comma it remembers it so that part seems to be working great as well finally let's say return a number and there we go the number actually got returned so only with these three comments github co-pilot knew how to use the react use state hook how to create the use effect and the set interval to increment that number in a proper react way and finally it returned the number if we were to run this code right now it would definitely work so the co-pilot gets a pass here as well now let's close this go back to our index.js one more time and let's see if github co-pilot knows how to deal with node.js we're going to give it just one single test and that is to create a simple express application as you can see it starts off by suggesting to require express then it initializes the express which is the correct thing to do then it even sets the view engine to ejs which is great it even sets the static folder it sets the index route with the app.get and it renders the index page that's also good let's see what else does it want to do and finally it starts the server by saying var server is equal to app.listen on the port 3000 there it sets the host and sets the port it's missing one last parentheses but that got fixed as well and there we go although this code seems a bit older like using vars and also for some reason decided to use the ejs and to set the static folder this code seems to be fully functional so github co-pilot created a simple express application from scratch that's going to be a pass as well and let's give it the final test which is going to be maybe the simplest one and that's to test if the co-pilot knows html so we can say index.html let's ask the co-pilot if it knows how to create the html5 portfolio so we want a simple portfolio i'm going to press ctrl enter and let's wait for the solutions let's browse through a few in here we have a lot of links this seems overly simple for example this one it has the links images everything i'm going to click accept solution and it looks like it stops in the middle so let's see if we can actually end it i'm going to go one more time for the solutions and this seems like the correct ending this should be the correct html page now let's reveal it in file explorer and finally open it in the browser we got a nice heading that says portfolio there and we have an inaccessible image from linkedin with some search button this doesn't look like something but the co-pilot definitely did create the simplest possible portfolio page now there's one really big problem with this we only clicked our mouse a few times and we haven't even typed anything that we can see here we didn't type this code out but for some reason github co-pilot decided to take somebody else's image and links and their entire code technically so what do you think if this code is proprietary who is going to get sued github co-pilot or you for using somebody else's code even without knowing it well the blame is going to be on you github says that even though this code was suggested to you you are the one responsible for it therefore you have to be careful which code you use and whether it belongs to somebody else you've seen what copilot can do now let's discuss the elephant in the room will github co-pilot or artificial intelligence in general replace developers co-pilot does not develop a completely functional application for you you can for example write a comment like develop an ecommerce application and expect copilot to take care of it the hard part of programming isn't programming a magical tool isn't going to change the fact that the value that engineers bring is problem solving and not the coding skills humans are creative and software development requires creativity programming is a mix of art and science and problem solving requires some deeper thinking that merely generating code in a visual layout moreover comprehending complex requirements to write production level code isn't something ai is ready to do yet in a foolproof way so even though applications like the cop pilot are helpful and super powerful i still believe we are far from being replaced by them github co-pilot would never kill skilled developers jobs if at all anything it is going to make them more productive i'm curious to know what do you guys think let me know in the comments down below as developers have to stick together now when we are faced with this threat so definitely hit a like and subscribe i really appreciate it i recently activated the javascript mastery mailing list we have a ton of interesting stuff that i'm sure you're going to love in the close future so if you want to stay up to date definitely make sure to join the link is going to be down in the description we also added a lot of new stuff to our discord channel so make sure to join as well the link is also in the description with that said subscribe so that we can see each other the next time as well and have a wonderful day you

Original Description

#GitHubCopilot - Artificial Intelligence that will presumably take your job. Will that really happen or is Microsoft just great at marketing this very advanced form of auto-complete? Well, here at JavaScript Mastery, we've gotten access to the early beta so that you can find out yourself. We're going to put it to the test on HTML, JavaScript, React, and even Node. 💻JS Mastery Pro - https://jsmastery.pro?discount=youtube ✅ A special YOUTUBE discount code is automatically applied! 📚 References: Sign up for the early beta - https://github.com/features/copilot/signup 📧 Join our JavaScript Mastery's Newsletter on Web Development, JavaScript & React to get exclusive programming guides, tips & tricks, and entire e-books: https://resource.jsmastery.pro/newsletter 🔥 💻 Discord - https://discord.gg/n6EdbFJ ⭐ Master JavaScript: https://www.completepathtojavascriptmastery.com/ Use the special promo code "YOUTUBE" on checkout to save $60! ❤️ Support JavaScript Mastery & Suggest Future Videos: BuyMeACoffe: https://www.buymeacoffee.com/JSMastery Patreon: https://www.patreon.com/javascriptmastery 💼 Business Inquiries: E-mail: javascriptmastery00@gmail.com Time Stamps 👇 00:00 Intro 01:52 Setup 02:43 Testing on JavaScript 08:24 Testing on React 11:58 Testing on Node 13:12 Testing on HTML 14:24 Proprietary Code 15:09 Conclusion
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from JavaScript Mastery · JavaScript Mastery · 53 of 60

1 Learn Async/Await in This Real World Project
Learn Async/Await in This Real World Project
JavaScript Mastery
2 JavaScript Exercise | Learn JavaScript with Exercism | #0 Setup
JavaScript Exercise | Learn JavaScript with Exercism | #0 Setup
JavaScript Mastery
3 JavaScript ES6 for Beginners
JavaScript ES6 for Beginners
JavaScript Mastery
4 ES7 and ES8 New Features
ES7 and ES8 New Features
JavaScript Mastery
5 Learn JSON in a Real World React App
Learn JSON in a Real World React App
JavaScript Mastery
6 How to Create PDFs With Node JS and React
How to Create PDFs With Node JS and React
JavaScript Mastery
7 Must Have Visual Studio Code Extensions
Must Have Visual Studio Code Extensions
JavaScript Mastery
8 Top 10 JavaScript Array Methods
Top 10 JavaScript Array Methods
JavaScript Mastery
9 JavaScript Map and Set Explained
JavaScript Map and Set Explained
JavaScript Mastery
10 Git Commands Tutorial for Beginners
Git Commands Tutorial for Beginners
JavaScript Mastery
11 Build and Deploy a YouTube Clone Application Using React
Build and Deploy a YouTube Clone Application Using React
JavaScript Mastery
12 React Hooks - Most Used Features
React Hooks - Most Used Features
JavaScript Mastery
13 JavaScript Best Practices and Coding Conventions - Write Clean Code
JavaScript Best Practices and Coding Conventions - Write Clean Code
JavaScript Mastery
14 Build and Deploy a Realtime Chat Application - Socket.io, Node.js, and React.js
Build and Deploy a Realtime Chat Application - Socket.io, Node.js, and React.js
JavaScript Mastery
15 How to Create and Deploy a Portfolio Site in less than 30 Minutes
How to Create and Deploy a Portfolio Site in less than 30 Minutes
JavaScript Mastery
16 SEO for Developers | 2020 SEO Tutorial
SEO for Developers | 2020 SEO Tutorial
JavaScript Mastery
17 Web Development Roadmap 2020 [Learning Path] - Start Coding at Home!
Web Development Roadmap 2020 [Learning Path] - Start Coding at Home!
JavaScript Mastery
18 Random Quote Generator - React Fetch API Data | Build and Deploy a Real Advice App Project
Random Quote Generator - React Fetch API Data | Build and Deploy a Real Advice App Project
JavaScript Mastery
19 Build a COVID-19 Tracker Application - React JS Project (Hooks, Material UI, Charts js)
Build a COVID-19 Tracker Application - React JS Project (Hooks, Material UI, Charts js)
JavaScript Mastery
20 JavaScript ES2020 - The Most Requested Feature Explained in 10 Minutes
JavaScript ES2020 - The Most Requested Feature Explained in 10 Minutes
JavaScript Mastery
21 Modern React Event Handling Using Hooks
Modern React Event Handling Using Hooks
JavaScript Mastery
22 Deno JS - Intro +  Real Life Example
Deno JS - Intro + Real Life Example
JavaScript Mastery
23 Build and Deploy a React PWA - Why Progressive Web Apps are the Future of the Web
Build and Deploy a React PWA - Why Progressive Web Apps are the Future of the Web
JavaScript Mastery
24 Build a REST API with Node JS and Express | CRUD API Tutorial
Build a REST API with Node JS and Express | CRUD API Tutorial
JavaScript Mastery
25 Build and Deploy an ARTIFICIAL INTELLIGENCE React App | Alan AI, JavaScript
Build and Deploy an ARTIFICIAL INTELLIGENCE React App | Alan AI, JavaScript
JavaScript Mastery
26 Master Async JavaScript using Async/Await | Quokka JS
Master Async JavaScript using Async/Await | Quokka JS
JavaScript Mastery
27 Spaced Repetition in Programming | mem.dev
Spaced Repetition in Programming | mem.dev
JavaScript Mastery
28 Stop Copy & Pasting Code | mem.dev
Stop Copy & Pasting Code | mem.dev
JavaScript Mastery
29 GitHub Profile README | Create an Amazing Profile Readme | Setup + Templates
GitHub Profile README | Create an Amazing Profile Readme | Setup + Templates
JavaScript Mastery
30 NEW GitHub CLI 1.0 is here! | GitHub CLI Tutorial - Demo & Commands
NEW GitHub CLI 1.0 is here! | GitHub CLI Tutorial - Demo & Commands
JavaScript Mastery
31 React Custom Hooks | Learn Custom Hooks & Build a Project
React Custom Hooks | Learn Custom Hooks & Build a Project
JavaScript Mastery
32 Learn how to deploy an NPM Package
Learn how to deploy an NPM Package
JavaScript Mastery
33 JavaScript Algorithms for Beginners
JavaScript Algorithms for Beginners
JavaScript Mastery
34 Level UP your GitHub Game - Get Hired Quickly
Level UP your GitHub Game - Get Hired Quickly
JavaScript Mastery
35 The Best Way to Host & Deploy a React Application
The Best Way to Host & Deploy a React Application
JavaScript Mastery
36 Full Stack MERN Project - Build and Deploy an App | React + Redux, Node, Express, MongoDB [Part 1/2]
Full Stack MERN Project - Build and Deploy an App | React + Redux, Node, Express, MongoDB [Part 1/2]
JavaScript Mastery
37 Full Stack MERN Project - Build and Deploy an App | React + Redux, Node, Express, MongoDB [Part 2/2]
Full Stack MERN Project - Build and Deploy an App | React + Redux, Node, Express, MongoDB [Part 2/2]
JavaScript Mastery
38 ECommerce Web Shop - Build & Deploy an Amazing App | React.js, Commerce.js, Stripe
ECommerce Web Shop - Build & Deploy an Amazing App | React.js, Commerce.js, Stripe
JavaScript Mastery
39 JavaScript Crash Course 2021 - Master JavaScript in One Video!
JavaScript Crash Course 2021 - Master JavaScript in One Video!
JavaScript Mastery
40 MERN Auth - Login with Email (JWT) + Google OAuth Authentication | React, Node, Express, MongoDB
MERN Auth - Login with Email (JWT) + Google OAuth Authentication | React, Node, Express, MongoDB
JavaScript Mastery
41 Chat Application using React JS - Build and Deploy a Chat App in 1 Hour (Microsoft Teams)
Chat Application using React JS - Build and Deploy a Chat App in 1 Hour (Microsoft Teams)
JavaScript Mastery
42 MUST USE Websites & Tools for Web Developers
MUST USE Websites & Tools for Web Developers
JavaScript Mastery
43 Learn Material UI in One Hour - React Material UI Project Tutorial [2022]
Learn Material UI in One Hour - React Material UI Project Tutorial [2022]
JavaScript Mastery
44 Shopify ECommerce Store with React & Next JS | BuilderIO
Shopify ECommerce Store with React & Next JS | BuilderIO
JavaScript Mastery
45 React Video Chat App | WebRTC Video Chat Zoom Clone | Tabnine
React Video Chat App | WebRTC Video Chat Zoom Clone | Tabnine
JavaScript Mastery
46 TypeScript Crash Course 2021
TypeScript Crash Course 2021
JavaScript Mastery
47 Build and Deploy a Premium Next JS React Website | Landing Page, Business Website, Portfolio
Build and Deploy a Premium Next JS React Website | Landing Page, Business Website, Portfolio
JavaScript Mastery
48 Full Stack MERN Project - Pagination & Search | React + Redux, Node, Express, MongoDB
Full Stack MERN Project - Pagination & Search | React + Redux, Node, Express, MongoDB
JavaScript Mastery
49 Build a BETTER Facebook Messenger Chat Application | React JS, Firebase, Chat Engine
Build a BETTER Facebook Messenger Chat Application | React JS, Firebase, Chat Engine
JavaScript Mastery
50 Build and Deploy THE PERFECT Portfolio Website | Create a Portfolio from Scratch
Build and Deploy THE PERFECT Portfolio Website | Create a Portfolio from Scratch
JavaScript Mastery
51 Full Stack MERN Project - Implement MERN Comments | React + Redux, Node, Express, MongoDB
Full Stack MERN Project - Implement MERN Comments | React + Redux, Node, Express, MongoDB
JavaScript Mastery
52 Turn an API into a Startup?! Build & Sell an API with JavaScript
Turn an API into a Startup?! Build & Sell an API with JavaScript
JavaScript Mastery
Exclusive First Look at GitHub Copilot - All you need to know
Exclusive First Look at GitHub Copilot - All you need to know
JavaScript Mastery
54 Build and Deploy a Google Maps Travel Companion Application | React.js
Build and Deploy a Google Maps Travel Companion Application | React.js
JavaScript Mastery
55 Build and Deploy a Full Stack Realtime Chat Messaging App with Authentication & SMS Notifications
Build and Deploy a Full Stack Realtime Chat Messaging App with Authentication & SMS Notifications
JavaScript Mastery
56 Build and Deploy a React Cryptocurrency App and Master Redux Toolkit in One Video
Build and Deploy a React Cryptocurrency App and Master Redux Toolkit in One Video
JavaScript Mastery
57 Build and Deploy a Group Video Chat Application with Messaging, Polls & More
Build and Deploy a Group Video Chat Application with Messaging, Polls & More
JavaScript Mastery
58 Build and Deploy Google Search 2.0 with React & Tailwind CSS (simple!)
Build and Deploy Google Search 2.0 with React & Tailwind CSS (simple!)
JavaScript Mastery
59 Top 10 Web Development Chrome Extensions You Simply Need to Try!
Top 10 Web Development Chrome Extensions You Simply Need to Try!
JavaScript Mastery
60 Build and Deploy THE BEST Modern Blog App with React | GraphQL, NextJS, Tailwind CSS
Build and Deploy THE BEST Modern Blog App with React | GraphQL, NextJS, Tailwind CSS
JavaScript Mastery

Related Reads

📰
Angular vs React: Key Differences, Pros & Cons Compared
Learn the key differences between Angular and React to decide which framework suits your project needs, considering factors like team size, project complexity, and desired level of flexibility.
Dev.to · Elsie Rainee
📰
Next.js Web App Development: Complete Guide for Fast, Scalable Applications (2026)
Learn how to build fast and scalable web applications using Next.js, a popular React framework, to improve user experience and conversion rates
Dev.to · Avanexa Technologies
📰
Next.js Quietly Fixed the Prefetch Problem Nobody Wanted to Talk About
Next.js fixed the prefetch problem, learn how to leverage this fix for better performance
Medium · JavaScript
📰
A Fast Request, a Fast Parse and a Slow Page
Optimize each phase of webpage loading to achieve target performance
Medium · JavaScript

Chapters (8)

Intro
1:52 Setup
2:43 Testing on JavaScript
8:24 Testing on React
11:58 Testing on Node
13:12 Testing on HTML
14:24 Proprietary Code
15:09 Conclusion
Up next
How to Use Semrush Keyword Magic Tool with ChatGPT to Make Money
Grow with Will - SEO, Sales & Entrepreneurship
Watch →