(CSGC) Documenting and Debugging Lesson
Documenting and Debugging
In computer programming, a comment is a note or annotation in the source code of a computer program. They are specially marked lines of code that are not evaluated.
Comments are used to:
- make the source code easier for humans to understand
- make maintenance much easier
- help find bugs faster
Java comments are grouped into two types:
1) Documentation comments
• Javadoc Comments
2) Implementation Comments
• Multi-line
• Single Line
Debugging Your Code
If there is a syntax error in your program, it will not compile. An error is referred to as a bug, so the process of correcting the error is called debugging. Debugging the program means finding the error and making the correction to the code so it will compile and run.
Recognizing and correcting errors in your program teaches good programming skills. If a program is very large, it is important to test it in intervals. After adding a functionality to the program, test it and debug.
[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION