PHASE 2 — CREATION INTERMEDIATE 40 MIN

GitHub Copilot &
AI Coding Tools

💻 Lesson 5 of 10⏱ 40 minutes🎯 Intermediate
AI coding assistants have fundamentally changed how software gets written. GitHub Copilot, Cursor, and Tabnine act as a pair programmer that never sleeps — auto-completing functions, generating boilerplate, explaining bugs, and writing tests. Even non-programmers use them to automate tasks. This lesson shows you exactly how to get the most out of them.

AI Coding Tools Compared

🤖
GitHub Copilot
Most widely used. Lives inside VS Code, JetBrains, Vim. Inline completions + chat. $10/month.
MOST POPULAR
🖱️
Cursor
AI-first code editor built on VS Code. Cmd+K edits, full codebase context, multi-file editing.
MOST POWERFUL
âš¡
Tabnine
Privacy-focused. Can run locally on your machine. Strong enterprise compliance. Free tier available.
BEST PRIVATE
💬
ChatGPT / Claude
Best for architecture questions, debugging complex logic, and generating code from scratch via chat.
BEST FOR CHAT

Getting Copilot to Write What You Actually Want

The key to Copilot is learning to guide it with context. Here are the most effective techniques:

COMMENT-DRIVEN DEVELOPMENT
// Write a comment describing what you want, then press Tab

// Fetch user data from API, handle errors, return parsed JSON
async function fetchUser(userId) {
  // Copilot fills this in based on your comment
}

// Validate email format and check it's not already in the database
function validateEmail(email, existingEmails) {
  // Copilot generates the validation logic
}
FUNCTION SIGNATURE HINTS
// Give Copilot a descriptive function name + parameter names
// It infers the intent and generates the body

function calculateMonthlyPayment(principal, annualRate, termMonths) {
  // Copilot knows this is a loan calculator from the names alone
}

function formatDateToRelative(date) {
  // "2 hours ago", "yesterday", "3 days ago" — Copilot writes it
}
💡
Multiple Suggestions
Press Alt+] (Windows/Linux) or Option+] (Mac) to cycle through alternative Copilot suggestions. Always review the first 2-3 options — later ones are sometimes better. Never blindly accept suggestion #1.

Using Copilot Chat for Debugging & Explanation

Copilot Chat (Ctrl+I in VS Code) is more powerful than inline completions for complex tasks:

  • Explain code: Select any code block → "Explain this step by step"
  • Fix bugs: Select the broken code → "Why does this fail? Fix it."
  • Write tests: Select a function → "Write unit tests for edge cases"
  • Refactor: Select code → "Refactor for readability without changing behaviour"
  • Add types: Select JS code → "Add TypeScript types to this"
  • Security check: Select code → "Are there any security vulnerabilities here?"
PROMPT TEMPLATES FOR CHAT
// Debugging
"This function returns undefined when input is empty. Debug and fix it."

// Performance
"This loops through 10,000 items. Optimize for speed."

// Documentation
"Write JSDoc comments for this function including params and return type."

// Convert
"Convert this callback-based code to use async/await."

Using AI Coding Tools Without Being a Developer

You don't need to be a programmer to benefit from AI coding tools:

📊
Excel / Sheets
Ask: "Write a Google Sheets formula that calculates running totals with conditional formatting."
🗄️
SQL Queries
Describe what you want in plain English → get a working SQL query. No SQL knowledge needed.
🔧
Automation
Ask Copilot to write Python scripts for file renaming, data cleanup, or web scraping.
🌐
Simple Websites
Describe a web page → get working HTML/CSS/JS. Deploy on Netlify or GitHub Pages in minutes.
⚠️
Always Review AI Code
AI coding tools are pair programmers, not autonomous developers. They make mistakes, introduce subtle bugs, and occasionally produce insecure code. Always read and understand what was generated before running it in production. Use it to go faster, not to skip understanding.
🧠 Quick Check — Lesson 5
1. Which AI coding tool is best described as an "AI-first code editor" with full multi-file codebase context?
2. In VS Code, what keyboard shortcut cycles through alternative Copilot suggestions?
3. Which AI coding tool is best for privacy-conscious teams and can run entirely on your local machine?