Good Coding Practices: Using Comments BEGINNER
Author : alexa-scheidler | Published Date : 2025-05-17
Description: Good Coding Practices Using Comments BEGINNER PROGRAMMING LESSON LESSON OBJECTIVES Learn why to comment code Learn the two types of comments available Learn what makes useful comments EV3Lessonscom 2020 Last Update 12282019 Why
Presentation Embed Code
Download Presentation
Download
Presentation The PPT/PDF document
"Good Coding Practices: Using Comments BEGINNER" is the property of its rightful owner.
Permission is granted to download and print the materials on this website for personal, non-commercial use only,
and to display it on your personal computer provided you do not modify the materials and that you retain all
copyright notices contained in the materials. By downloading content from our website, you accept the terms of
this agreement.
Transcript:Good Coding Practices: Using Comments BEGINNER:
Good Coding Practices: Using Comments BEGINNER PROGRAMMING LESSON LESSON OBJECTIVES Learn why to comment code Learn the two types of comments available Learn what makes useful comments © EV3Lessons.com, 2020 Last Update: (12/28/2019) Why bother with comments? Comments in code help the author of the code remember what they were trying to accomplish. You can use them to record the goals or pseudocode for the code. It makes it easier to debug. You could use it to take notes on values More importantly, comments allow someone other than the author of the code to understand the program. Get into the habit of adding comments to your code © EV3Lessons.com, 2020 Last Update: (12/28/2019) Types of Comments: Text Boxes The EV3 allows you to add grey text boxes of any size. They are found at the top right corner of your screen. They can be used for lots of text, but will have to be manually moved with the corresponding code blocks if you add or delete code. © EV3Lessons.com, 2020 Last Update: (12/28/2019) Types of Comments: Comment blocks The Comment Block can be found in the Blue Programming Pallet Tab. The advantage of using this block is that like any other block, it stays with the code as you modify it. © EV3Lessons.com, 2020 Last Update: (12/28/2019) USEFUL & NOT USEFUL Comments + Telling the reader what the robot is doing at this point in the code (hitting the lever with motor A, turning to the right and going towards the Mission X) - Repeating the contents of a block of code (e.g. Move straight 1040 degrees). © EV3Lessons.com, 2020 Last Update: (12/28/2019) TIPS FOR COMMENTING CODE Commenting your code is very important. However, note that the blue comment blocks (even if used in a parallel beam) can change the timing of programs. Therefore, if your team uses a lot of comments, try to use the grey text boxes instead. © EV3Lessons.com, 2020 Last Update: (12/28/2019) Text Box Comment Block CREDITS This tutorial was created by Sanjay Seshan and Arvind Seshan More lessons are available at www.ev3lessons.com This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. © EV3Lessons.com, 2020 Last Update: (12/28/2019)