Lesson 1155 of 1455
Writing Prompt Comments So AI Builds the Right Function
Drop a clear comment above a stub and Copilot or Cursor fills in the rest — usually correctly.
Builders · AI-Assisted Coding · ~4 min read
The big idea
AI coding assistants treat your comments as instructions. A specific one-line comment above a function stub gets you working code; a vague one gets you guesswork.
Some examples
- You write '// returns true if email is valid, else false' and Copilot fills in the regex and return logic.
- Cursor reads your '// fetch user by id, retry once on 500' comment and writes the fetch with retry baked in.
- You write '// debounced search by 300ms' above an empty handler and Claude completes it with setTimeout cleanup.
- Codex sees '// sort tasks by due date, nulls last' and writes the comparator without you spelling out edge cases.
Try it!
Open any project, delete a small function, leave a one-line comment of what it should do, and let Copilot or Cursor refill it.
Key terms in this lesson
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
Builders · 7 min
GitHub Copilot vs Cursor: Which AI Coding Tool When?
Copilot is great at finishing the line you're typing; Cursor is great at editing across files. Pick the right one for the job.
Builders · 25 min
What Does AI-Assisted Coding Even Mean?
AI-assisted coding is not magic and not cheating. It is a new way of working where a model drafts, you decide. Let's draw a map before we start building.
Builders · 8 min
AI and Mobile App Dev: Building Your First iPhone App
Using AI as a coding mentor while you learn to build a real mobile app.
