Loading lesson…
Type a comment like 'make the ball bounce' and AI fills in the code below.
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!
Imagine a tiny game. Write 3 comments like 'make the player jump'. AI would fill in the code!
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.
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-explorers-ai-coding-AI-and-the-comment-trick
What is a code comment?
In Python, comments start with which symbol?
In JavaScript, comments start with which symbol?
You type '# make the ball bounce' in a Python file. What does AI often do next?
What is the 'comment-first, code-second' method?
Which shows the 'comment becomes code' trick in action?
What is GitHub Copilot?
You want to write a program with 5 features. Using the comment-first method, what do you write FIRST?
A code comment says: '# This function checks if the player won.' The code below it is complex. What job does the comment do?
Which comment is BETTER as code documentation?
What happens to a code comment when the computer runs the program?
You write 3 comment lines describing a tiny game. You ask AI: 'Write code for each of these comments and keep the comments in the final code.' What do you get?
Professional programmers use the comment-first method. Why?
What makes comments a 'superpower' for future-you?
Which is the BEST use of the 'comment trick' with AI?