In: Computer Science
Explain why commenting code is important. Include an example of a good comment and of a bad comment. This should be done with matlab in mind.
comment the code is very important thing.one who write the code easily understand but if otherperson also want to understand then we must write comments for well understand.
in generally if any software is developing lot of programmers working on the same project so they want share the same source based on the source code they will move forware so then kind of situations every one must know the logics of the code then they will use comments for other people want to understand.
bad comments in the sense no need to write every line as comment because then code looks not good then we must use comments very important things which as some logic is there.
good comments in the sense every important point must be commented then it was looks good
#sample code for good comment
#bad comment
here the condition was present at line to but the description of line is present in 6 so it was not good idea and not good comment.