A-level Computing 2009/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Fundamentals of Programming/Comments





Over the course of the next few chapters you might see a lot of text in the code examples that doesn't seem to do anything other than aid understanding of the code. This text is called a comment and if you have this book in colour you'll see that these comments are highlighted in green.

In Visual Basic all comments start with an apostrophe (') or the word. Let's take a look at a quick example:

Another use for comments is to disable code that you don't want to delete but you do want to keep. By commenting out the code it means that you can always restore it later if you want to. It isn't a good idea to leave commented out code in final code, but it is a very common practice when you are developing something: