+ 3
What is use of comment tag...if it is not displayed on webpage....plz explain
beginner
4 Answers
+ 5
Comments are used for notes in the markup so that it will be easier to understand by other developers.
Comments can also be used to temporarily remove a part of the code for testing purposes.
+ 3
To summarize what the code does. It also helps explain what is going on in the code when working in teams.
Also to further intellisense information in some IDEs.
+ 1
Comments are basically internal documentation. It allows you to explain how a chunk of your code works to yourself and others. In small projects it might not seem too important but in projects of larger scale it's a necessity to use comments to explain how your code works, why it works, what it's there for, etc.
+ 1
Comments are useful for various reasons such as:
- They may explain what a particular function does
- They may explain something which might not be obvious to the reader
- They may clarify your intention behind a certain line or block of code
- They may serve as a reminder to change something in the future.
- They may be used to comment out code without completely removing it.