What's the point of using comments? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What's the point of using comments?

Im new I started today and have been playing around with what I've learned. Whats the point of using comments?

28th Sep 2016, 11:43 PM
PrinceOfPens
PrinceOfPens - avatar
6 Answers
+ 4
Comments allow you to write plain text in your application without causing syntax errors. This allows you to take notes, comment out lines of code so the code doesn't run and leave notes for other users who may edit your application where the notes will help them identify how the application works quickly than compared to sitting down and reading line by line.
28th Sep 2016, 11:48 PM
Kurtis Robinson
+ 3
Leaving comments not only makes the code more easy to understand, it also allows other programmers to know what a specific function is doing. It allows you to write TODO lists or to simply remember what your code does. There are times when you're going to review your own code and you will have no idea why it does something. Comments help to avoid these kind of problems.
29th Sep 2016, 1:14 AM
ABC
ABC - avatar
+ 2
OOHH that makes a lot more sense now!
29th Sep 2016, 1:05 AM
PrinceOfPens
PrinceOfPens - avatar
+ 1
In addition to readability, sometimes the code remains unchanged for a long time, after which hardly remember everything.
29th Sep 2016, 1:26 AM
ma0
0
Required for reference points when you need to edit your code a year or so down the road.
5th Oct 2016, 1:55 AM
Raj
Raj - avatar
0
To understand your code properly by another programmar or user. As a problem can be solved in multiple ways or user can give variable name in their own choice which is hard to understand by another person without comment.
19th Feb 2017, 7:54 AM
Crazy_Bug
Crazy_Bug - avatar