1 Introducing AI-assisted programming with Copilot


This chapter covers

  • How AI assistants change how new programmers learn
  • Why programming is never going to be the same
  • How AI assistants like Copilot work
  • How Copilot solves introductory programming problems
  • Possible perils of AI-assisted programming

In this chapter, we’ll talk about how humans communicate with computers. We’ll introduce you to your AI assistant, GitHub Copilot, an amazing tool that uses artificial intelligence (AI) to help people write software. More importantly, we’ll show you how Copilot can help you learn how to program. We’re not expecting that you’ve written any programs before. If you have, please don’t skip this chapter, even if you already know a little bit about programming. Everyone needs to know why writing programs is different now that we have AI assistants like ChatGPT and Copilot, and that the skills we need to be effective programmers change. As we’ll see, we also need to be vigilant, because sometimes tools like ChatGPT and Copilot lie.

1.1 How we talk to computers

Would you be happy if we started by asking you to read and understand the code below?1

section .text 
global _start 
   mov ecx, 10 
   mov eax, '0' 
   mov [num], eax 
   mov eax, 4 
   mov ebx, 1 
   push ecx 
   mov ecx, num 
   mov edx, 1 
   int 0x80 
   mov eax, [num] 
   inc eax 
   pop ecx 
   loop l1 
   mov eax, 1 
   int 0x80 
section .bss 
   num resb 1

1.1.1 Making it a little easier

1.1.2 Making it a lot easier

1.2 About the technology

1.2.1 Copilot, your AI Assistant

1.2.2 How Copilot works behind the scenes—in 30 seconds

1.3 How Copilot changes how we learn to program

1.4 What else can Copilot do for us?

1.5 Risks and challenges when using Copilot

1.6 The skills we need

1.7 Societal concerns about AI code assistants like Copilot