Lesson 851 of 1234
Write a Comment, Get the Code
Type a comment like 'make the ball bounce' and AI fills in the code below.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1The big idea
- 2comment
- 3documentation
- 4copilot
Concept cluster
Terms to connect while reading
Section 1
The big idea
Did you know you can write a sentence in code (called a comment) and AI fills in the real code? Type '# make the ball move right' and AI writes the lines under it. Magic!
Some examples
- // add 1 to the score → AI writes: score = score + 1
- # print hello three times → AI writes the loop
- // turn the player blue → AI writes the color line
- Comments become code.
Try it!
Imagine a tiny game. Write 3 comments like 'make the player jump'. AI would fill in the code!
Comments are your secret coding superpower 💬
Comments are lines of text INSIDE your code that the computer completely ignores. They're there for humans — you, your friends, or your future self — to understand what the code is doing. In Python, comments start with #. In JavaScript, they start with //. The computer jumps right over them! But here's where the magic happens with AI: AI coding assistants like GitHub Copilot watch as you type comments and automatically suggest the CODE to make that comment real. Write '# move the player right when pressing arrow key' and AI fills in the actual movement code underneath. It's like thinking in words and having AI translate to code! 🪄 Comments also help you as a planner. Before writing any code, you can write your whole program as comments — step 1, step 2, step 3 — and then ask AI to fill in the code for each comment. This 'comment-first, code-second' method is used by real professional programmers and it keeps your code organized and easy to understand.
- In Python, a comment starts with # (pound sign) — everything after it is ignored by the computer
- In JavaScript, a comment starts with // — same idea, different symbol
- AI coding assistants read your comments and suggest code that makes them real
- Plan your whole program as comments FIRST, then ask AI to fill in the code for each step
Key terms in this lesson
Key terms in this lesson
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “Write a Comment, Get the Code”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Explorers · 40 min
Use AI to Fix Code That Does Not Work
When your code breaks, AI is amazing at finding the problem. Way faster than just staring at it.
Explorers · 40 min
How Comments in Code Help AI Help You
Adding little notes called comments helps AI understand your goal.
Explorers · 5 min
Smart Coders Ask AI to Write Tests First
A 'test' is a tiny check that proves your code works — AI can write them.
