comments

Programmers use comments to add descriptive text to their programs. Every programming language that I am aware of allows programmers to do this, and NXT-G is no exception. Use comments to tell other programmers how your program works or why you made certain decisions. For example, you could add a comment to the previous program to explain why you added the Wait Time block.

In the previous chapter, I mentioned that a good program should be easy to modify and understandable to other programmers. Good comments are important in achieving both of these goals. It can be very difficult to figure out how a program works just by looking at the settings for each block. A short description in plain English (or whatever language you speak) will make ...

Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.