# Code Comments > Eighth graders build programming skills by learning what code comments are - notes in a program that the computer ignores but people read - why they matter, and how to write good ones, then check what they know. **Computer Science** | **Grade 8** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g8-cs-code-comments.html* Eighth graders learn that the best programmers write for people as well as computers, using comments to explain their code so others, and their future selves, can understand it, then check what they know. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Know what a **comment** is. - See the computer **ignores it**. - Write **useful comments**. - Check what you know. You open code you wrote months ago and cannot remember how it works, and a short note in the code could have saved you. What are comments, and why do programmers write them? ## Comments Check Project this and answer each question about comments and how they make code easier to understand — read the explanation after each one. ## 50 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Notes for Humans You open code you wrote months ago and cannot remember how it works. A short note left in the code could have saved you. What are comments, and why do programmers write them? #### 👩‍🏫 Teacher Moves - Show code with and without comments. - Ask which is clearer. - Set the goal. #### 🎒 Student Actions - Think. - Share. - Get ready. ### Use — Comments Check Students answer questions about comments. #### 👩‍🏫 Teacher Moves - Send students to the Comments Check. - Answer each question. - Read the why. #### 🎒 Student Actions - Answer. - Check. - Read it. ### Modify — Comment the Code Students add a helpful comment. #### 👩‍🏫 Teacher Moves - Read a line of code. - Write a comment for it. - Say what it explains. #### 🎒 Student Actions - Read. - Write. - Say. ### Create — My Commented Program Students comment a short program. #### 👩‍🏫 Teacher Moves - Take a short program. - Add a comment at the top. - Explain the tricky parts. #### 🎒 Student Actions - Take. - Add. - Explain. ### Reflect — Writing for People Students reflect on comments. #### 👩‍🏫 Teacher Moves - Does the computer run your comments? - What makes a comment helpful? - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say it. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Document a program with comments to make it easier to follow. Systematically improve and maintain programs for others to use. Describe how documentation helps people work together on code. Computational Thinker: create and document clear, reusable solutions. ## One lesson, every learner ### Multilingual Learners - Code snippet cards. - Sentence frame: “This comment explains ___ .” - Answer one question at a time. ### Support & Access - Start with what a comment is. - Add one comment together. - Review one idea at a time. ### Stretch & Extend - Rewrite a weak comment into a useful one. - Comment a short program fully. - Explain when a comment is not needed. ### What to gather - 📽️Projector / board - 🖼️Code snippet cards - 💻Comments Check - 💻A short sample program - ✏️Pencils - 🎫Exit-ticket slips ### Key terms - **comment**: a note in code for people, ignored by the computer - **code**: the instructions that make up a program - **documentation**: notes that explain how a program works - **readable**: easy for a person to understand - **maintain**: to keep code working and up to date over time - **syntax**: the symbols that mark a comment in a language - **collaborate**: to work together on the same code - **clutter**: too much that gets in the way of reading ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Create: my commented program. Have students take a short program, add a comment at the top, and explain the tricky parts, so writing for people becomes part of coding. A printable code-comments worksheet is in the Computer Science library. ## Check your understanding **1. What does “comment” mean?** - a note in code for people, ignored by the computer *(correct)* - the instructions that make up a program - notes that explain how a program works - easy for a person to understand “comment” means: a note in code for people, ignored by the computer **2. Which word means: “the instructions that make up a program”?** - comment - code *(correct)* - documentation - readable “code” means: the instructions that make up a program **3. What does “documentation” mean?** - a note in code for people, ignored by the computer - the instructions that make up a program - notes that explain how a program works *(correct)* - easy for a person to understand “documentation” means: notes that explain how a program works **4. Which word means: “easy for a person to understand”?** - comment - code - documentation - readable *(correct)* “readable” means: easy for a person to understand **5. What does “maintain” mean?** - to keep code working and up to date over time *(correct)* - a note in code for people, ignored by the computer - the instructions that make up a program - notes that explain how a program works “maintain” means: to keep code working and up to date over time **6. Which word means: “the symbols that mark a comment in a language”?** - comment - syntax *(correct)* - code - documentation “syntax” means: the symbols that mark a comment in a language ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g8-cs-code-comments.html All lessons: https://lessonplans.k12academics.com/