Fireship · @fireship

The Truth about Github Copilot // AI Programming First Look

Uploaded June 30, 2021 · Length 8:30

The Truth about Github Copilot // AI Programming First Look

Summary

Fireship reviews Github Copilot, an AI tool that generates code based on user input, using GPT-3 and trained on 175 billion parameters.

  • github copilot
  • ai programming
  • gpt-3
  • code generation
  • artificial intelligence
  • machine learning

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    in the not so distant future you'll

  2. 0:01

    likely be writing far fewer lines of

  3. 0:03

    code than you are today

  4. 0:04

    because artificial intelligence is

  5. 0:06

    coming to a vs code near you

  6. 0:08

    microsoft aka github just announced

  7. 0:10

    copilot yesterday

  8. 0:11

    a tool powered by gpt3 capable of

  9. 0:14

    writing code automatically

  10. 0:15

    all you have to do is write a

  11. 0:17

    descriptive function name or some

  12. 0:18

    comments

  13. 0:19

    and it will automatically fill in the

  14. 0:20

    implementation details for you

  15. 0:22

    and it's not just inserting a snippet

  16. 0:23

    this is actual novel code

  17. 0:25

    that has never been seen before it looks

  18. 0:27

    at the code you've already written in

  19. 0:28

    your project as

  20. 0:29

    context and attempts to generate new

  21. 0:31

    code to match it perfectly

  22. 0:32

    for example imagine you've written a

  23. 0:34

    react component and you now want to

  24. 0:36

    write a unit test for it

  25. 0:37

    just write a comment describing what you

  26. 0:39

    want to test and copilot will generate

  27. 0:41

    the code based on your component

  28. 0:42

    and the testing framework that you're

  29. 0:43

    using or say you want to calculate the

  30. 0:45

    number of days between two dates for me

  31. 0:47

    that's an instant google search then

  32. 0:49

    stack overflow copy and paste

  33. 0:50

    with copilot all i have to do is write a

  34. 0:52

    function name and it implements the

  35. 0:54

    function body for me automatically if

  36. 0:56

    i'm not perfectly happy with the

  37. 0:57

    implementation

  38. 0:58

    i can click a button to get the next

  39. 0:59

    prediction anything that might have

  40. 1:01

    brought you to stack overflow can be

  41. 1:02

    autocompleted in your ide

  42. 1:04

    and custom tailored to fit your code

  43. 1:06

    base developers like to joke about how

  44. 1:08

    often they google things and copy

  45. 1:09

    answers from stack overflow

  46. 1:11

    so you can only imagine how big of a

  47. 1:12

    time saver this is going to be

  48. 1:14

    i just got access to copilot myself so

  49. 1:16

    let's dive in and see how useful it

  50. 1:18

    really is

  51. 1:18

    i just installed the extension and bs

  52. 1:20

    code which required me to authenticate

  53. 1:22

    with my github account i've got a

  54. 1:24

    front-end vanilla javascript project

  55. 1:25

    here

  56. 1:26

    with files for my html css and

  57. 1:29

    javascript you'll notice a little

  58. 1:30

    copilot icon down here at the bottom

  59. 1:32

    that just allows you to toggle it on or

  60. 1:34

    off the first thing i want to try

  61. 1:35

    is to define a function called

  62. 1:37

    intersection of arrays

  63. 1:39

    and see if it can complete the body of

  64. 1:40

    that function successfully

  65. 1:42

    we'll give the function a name of

  66. 1:43

    intersection of o and it just predicts

  67. 1:45

    the name of the function that we're

  68. 1:46

    going to write and it looks like it's

  69. 1:48

    being implemented correctly

  70. 1:49

    but there are multiple ways we could

  71. 1:51

    implement this function let's go ahead

  72. 1:52

    and delete the code back to the function

  73. 1:54

    name

  74. 1:54

    if we hover over the automatically

  75. 1:56

    generated code we can click next

  76. 1:58

    to cycle through different suggestions i