Prompt engineering with GitHub Copilot
Think about a magic lamp and a genie that lives inside who knows how to code. That genie is a GitHub Copilot for you. However, instead of rubbing the lamp and telling the genie your wish, you use prompts or special instructions to tell them what kind of coding magic you want them to perform. You wouldn’t just say, make a sandwich. You’d give the genie step-by-step instructions, such as get two slices of bread, spread peanut butter on one slice, and so on.
This process of giving the genie specific instructions and telling them exactly what you wish for is known as prompt engineering.
Figure 13.21 – GitHub Copilot as a lamp genie
How does prompt engineering work?
Let’s say you’re building your one-page portfolio website and you want to add a new feature, such as a photo gallery. Instead of writing all the code yourself, you ask GitHub Copilot for help. But here’s the trick...