What are comments used for? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What are comments used for?

13th Aug 2015, 1:46 PM
Mynks Mynks Villa
Mynks Mynks Villa - avatar
19 Answers
+ 5
If you want to be a Professional web developer.You should use comments
12th Jun 2016, 9:57 PM
Mohammad Nur
Mohammad  Nur - avatar
+ 4
in simple words comments is explanation of the codes ;what is this code ; why did you used it and so on, comments usually will help you in the future to remember why u have used this single line of codes and it will help others to understand your program when they read it hope this will help you.
25th Dec 2015, 7:56 AM
Mohammed
+ 2
Adding Comment in script helps other to understand your logic behind the code and others can uderstand easily your coding
18th Jun 2016, 8:32 PM
Saumil Pansheriya
Saumil Pansheriya - avatar
+ 2
comments are text you dont want the computer to work on
7th Jun 2020, 9:23 AM
Toyin Samad Akanbi
Toyin Samad Akanbi - avatar
+ 1
// is used for comment and /* is used for multiple comment lines */
13th Sep 2015, 3:12 PM
jay
jay - avatar
+ 1
1. make description 2. deactivate a line of code or some lines of code :D
12th Jan 2016, 12:24 AM
Achmad Chamdan
Achmad Chamdan - avatar
+ 1
I like to think of comments as a way to hide text inside the code for any purpose you want: for your future reference, for explaining the code to other developers or yourself (after a while you tend to forget why you code something in that way), for a quick way to exclude sections of code when you are trying and debugging, or even to leve secret love messages to a love one hahaha.. There are also some programs (like Ide's) that make use of comments to interact with code when implementing behaviour during code generation. I found and example like this in a pluging for writing UI in Eclipse (Eclipse is a Ide for Java code developing and other languages)...
11th Jun 2016, 3:30 PM
Nelson Urbina
Nelson Urbina - avatar
+ 1
A comment is used whenever you want to leave relevant info about your code or some other relevant info. It is good practice and helps you or others who are working with the code. It can also have other usages as deactivate code.
27th Jun 2016, 10:37 AM
Pedro Carvalho
Pedro Carvalho - avatar
0
Comments are usually used for the programmer to remind himself of what he was doing.
21st Oct 2015, 9:19 PM
Philip Julian
Philip Julian - avatar
0
comments is used for remember the functionality of the code by commenting the specific meaning. this code will not show up in the output.
12th Feb 2016, 6:24 PM
Patricia Ayrah Reyes Otero
Patricia Ayrah Reyes Otero - avatar
0
often used to explain some part of the code, what it does or intented to do. useful for the author of the code, or others who will work with the code in the future
1st Apr 2016, 2:09 PM
Pavlo Charnyi
Pavlo Charnyi - avatar
0
to add secret messeges in your page :)
10th Apr 2016, 1:44 PM
Siham El ghazouani
0
they are for extra information on the code
18th Apr 2016, 11:31 AM
Toyin Samad Akanbi
Toyin Samad Akanbi - avatar
0
That's for understanding your code for yourself and others, specially after some months!
13th Jun 2016, 4:37 PM
Edris Feiz marzooghi
Edris Feiz marzooghi - avatar
0
IT IS USED.TO ADD.THE.COMMENT OF YOUR PAGE
18th Jun 2016, 6:33 PM
Sulabh Sharma
Sulabh Sharma - avatar
0
In case you want to, Change the certain par t of webpage or you have made a mistake and you want to change it then probably searching for the mistake without even the slightest idea will be difficult but if you know where mistake is it it will be a lot easier for you to find mistake and change it and in fact in the some big websites it is nearly impossible to find the mistake without knowing where the mistake is so we use it
1st Jul 2016, 2:11 PM
Rajeev Tripathee
Rajeev Tripathee - avatar
0
to make a description or // this use for single line deactivate Nd /* is used for multiple comment line */
5th Jul 2016, 4:15 PM
Mahesh Bhola
Mahesh Bhola - avatar
0
May I ask the script scrol box
14th Sep 2016, 11:31 AM
umar pratama
umar pratama - avatar
0
The purpose of comments is to explain the meaning of parts of your code, so other programmers know what it means, and so you know what it means if you come back years later.
22nd Dec 2016, 10:53 PM
Erik Johanson
Erik Johanson - avatar