Comments
A comment in programming is text in our source code that the compiler ignores. And if it is ignored, why do we put it on? Usually to give us internal explanations of what the function of each part of the program is. They are also very useful for temporarily discarding code fragments, without having to delete them, and thus facilitate their later recovery.
Comments in programming are essential:
- They facilitate understanding: not only of other users but also of the programmer himself throughout the duration of the development of the program.
- They encourage collaboration: they make the code understandable for other co-programmers who can also participate.
- They facilitate error debugging: commenting and uncommenting code fragments will allow us to detect where errors are occurring.
Comments in Scratch
In Scratch you can add comments from the code editing window associated with each object. Comments can be either associated with a block or on the editing window itself. They are added by right-clicking on the place where we want to insert the comment.
Once added, they remain as visible notes in the code editing area.
Of course in Scratch there is no option to comment and uncomment blocks so that they are not taken into account by the compiler. The option available to do this is to separate the event that determines the execution of that block and the code will be temporarily deactivated.
No Comments