Tulika Rawat Ohh ,you mean comments during lessons .
Those comments are very helpful , sometime your concepts may not be clear by lessons then you can take help of those comments,you will find solutions of many of your doubts there.
Comments are used to explain the meaning of code or exact purpose of particular syntax .
It gives theory meaning about syntax and due to whuch it easy to learn and understand to coder or ither person to understand.
Tulika Rawat Comments are posted by the user. They share their opinion, doubts, and information by comments ragarding to that specific topic or question.
See those just by tapping on comments, you can leave a comment there also.. So that, You can understand it clearly..
Other usage of programing comments:
- in IDE for showing tips during coding
- for autogeneration of documentation, e.g. for REST API
- for generation of database structure (DDL)
But question author asks about some other comments as I understood by conversation.
Comments are added with the purpose of making the source code easier for humans to understand the step or task about to be executed by the code, and are generally ignored by compilers and interpreters.
It also helps to understand better the code even after long time without checking on it