Lesson 726 of 1169
How Comments in Code Help AI Help You
Adding little notes called comments helps AI understand your goal.
Explorers · AI-Assisted Coding · ~24 min read
The big idea
Comments are notes inside code that the computer ignores but humans (and AI) read. Adding them helps AI know what you're trying to do.
Some examples
- // I want this to count down from 10 to 1.
- # Make this happy when the player wins.
- Adding a comment then asking 'finish this' often works great.
- AI also writes comments — ask 'explain each line with a comment'.
Try it!
Write one line: '// I want a button that says hi when clicked'. Ask AI to write the code that does that.
Practice this safely
Try this with a low-stakes example and a trusted adult nearby. The goal is to notice how AI talks about comments, not to let it make the decision for you.
- 1Ask AI to explain comments in plain language, then underline anything that sounds uncertain or too broad.
- 2Give it one detail from "How Comments in Code Help AI Help You" and ask for two possible next steps plus one reason each step might be wrong.
- 3Check code clarity against a trusted source, teacher, adult, expert, or original document before you use it.
End-of-lesson quiz
Check what stuck
8 questions · Score saves to your progress.
Lesson help
Questions are best handled with a grown-up here.
For this age range, Tendril keeps freeform AI chat paused until parent/guardian consent and child-safe moderation are fully verified. Use the quiz, notes, and related lessons below, or ask a parent, guardian, teacher, or librarian to work through the question with you.
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 AI Helps Make Sure Code Actually Works
AI can write 'tests' — little checks that make sure your code does what you want.
Explorers · 5 min
AI Helping You Code: What Even Is That?
AI can help write computer code. You type what you want, AI writes the code. Here is what that looks like and why it is so cool.
