Presentation is loading. Please wait.

Presentation is loading. Please wait.

Comments Tonga Institute of Higher Education. Introduction No matter how smart you are, you will forget what your code does! Comments make your code more.

Similar presentations


Presentation on theme: "Comments Tonga Institute of Higher Education. Introduction No matter how smart you are, you will forget what your code does! Comments make your code more."— Presentation transcript:

1 Comments Tonga Institute of Higher Education

2 Introduction No matter how smart you are, you will forget what your code does! Comments make your code more understandable.  Add general reminders for what you’re doing. A description for each class. A description for each method.  Add notes for complicated code. If you have comments, it will be easier in the future.  Other miscellaneous reasons Ex: This code is a workaround for a documented bug: Microsoft Knowledge Base Article #3275593 Ex: Modified by Dave Shin on 02/02/2004. This was changed to fix Bug #25973 Others who maintain your code will appreciate this! If you have to work with code you’ve written before, you will appreciate this!

3 Comments Comments are always ignored during compilation and the execution of the program Use a single quotation mark to add a comment  ‘ Comments continue until the end of the line Comments can start anywhere in a line

4 Comment Flowerboxes Comment blocks at the beginning of a class can give details about the class.  Developers who have worked on it  Date the program was written  The purpose of the program  Copyright notices  Milestones  Contact information  General comments Many developers like to make “ flower boxes ” :

5 Example: No Comments

6 Example: Good Comments


Download ppt "Comments Tonga Institute of Higher Education. Introduction No matter how smart you are, you will forget what your code does! Comments make your code more."

Similar presentations


Ads by Google