views
Understand the purpose of commenting a computer program. Readability is the key thing here. When you look at a comment you should know that it is a comment and not a line of code. The comment should also be helpful not just to you, but to anyone else that might read the source code of your computer program.
Think of a short, simple way to get across your point. Comments don't need to be a work of art. They should be concise, neat, and straight to the point. This should not, however, discourage the use of multiple lines for a comment. The point is that the information needs to get across to the reader.
Write the comment using the appropriate syntax given by the programming language.
Ask yourself if the comment you've written is detailed enough. A comment should be able to tell someone looking at the source code what that part of the program actually does without having to compile it and run it. Does your comment accomplish this? Does it convey all the details?
Comments
0 comment