2 First steps with AI-assisted coding
This chapter covers
- Getting started with GitHub Copilot
- Creating a Python environment for a Python project
- Building a project using generated code
- Using code completion to generate snippets
- Using the Copilot Chat interface
Getting started with Generative AI tools can be daunting. Many people frequently ask me: How do I get started? Which one do I choose? Fortunately, the easiest way to start is to pick a tool and experiment. Once you do, you’ll find the learning curve surprisingly small.
In this chapter, we will get started by using GitHub Copilot. To learn the basics, we’ll jump in headfirst to solve a programming problem. We’ll build a useful application in Python with assistance from Copilot. By the end of this chapter, you’ll be comfortable using Copilot to assist you when writing code.
2.1 What is GitHub Copilot?
Do you remember the “rubber duck” debugging method? You visualize a rubber duck on your desk and explain the issue to it. You can use a real rubber duck or, like me, a toy wizard. I’ve confided in that wizard many times, working through problems. The key is to verbalize the issue to an imaginary helper. Once you express the problem in words, you might find answers you didn't see before. This shift in focus helps you think of solutions you haven’t considered.