New course! Every coder should learn Generative AI!
Try a free lesson+ 14
[DUPLICATE] What is the point of commenting?
Hey guys just womdering what is the point of commenting if it gets ignored by the ide
59 Answers
+ 36
It's like making notes in a reference book, highlighting stuff here and there and explaining to yourself why things are so. Those may be ignored by other people reading the book, but it would help people to understand what you did.
+ 17
Remembering what you did/how it works since you must forget sometimes what an specific part of the code does, explaining the code for any other programmer that will work on it
+ 16
comment is explaining something, & indicate things that are still to complete, for the next person working on the code and can just be a description, it doesn't have to be code.
+ 14
Goods comments are an important part of your code. It's important for other programmers to understand your code. An is important for you too, when you need to remember what you write in the future.
+ 11
Because it helps viewers to understand your code better
+ 10
READ THIS TO KNOW THE FACT:
the point of comment is that - you can write;
//this code is written by 'Min Somai'
and give credit to your work without other programmers questioning you that this has nothing to do with the program.
+ 9
Commenting is important for the programmer and anyone who updates or modifies your code. For example, if you sell a program to a customer, they'll need the comments for reference if something needs a hot fix or something like that
+ 9
notes and easier to find things
also it doesnt got ignored by the ide itself, the compiler ignores it only when it runs
+ 5
Comments are good when your code requires explanation. You should write your code such that it's self documenting, but sometimes comments can help explain what the intended purpose of your code is when it's a little more complex.
You should try to avoid using them as much as possible, but they can help for the reasons I stated above.
+ 5
you don't forget variables you declared with their functions.
make it easy to read ya code even after a very very long time
+ 5
I think the point of comments differs from person to person. I never used to use them but found that I would come back to code I wrote weeks of months before, maybe to make some improvements or changes, and the first thing I'd think is 'how does this work again?' I find comments really useful for helping me remember what my code does but also when I've worked with other people it helps us to develop code collaboratively. But it's not for everyone, I've worked with a guy who didn't like the use of comments and said he found it harder to read the code. I think it's a matter of opinion.
+ 5
Others can understand what you wrote
(No one can understand my codes Not even myself )
😅😅😅
+ 5
You create a program today without comment. Then years later you come back to see it. You say "who write this, why he do this, why do that" because you forgot to write comment. This happen to me.
+ 4
Well !! It helps to make the program more user-friendly
+ 4
It makes your code easy understandable ... and it can serve as a chat between programmers ;)
+ 4
Comments are mainly for Advice for Quetions
+ 4
there is none! Indeed, comments can be even misleading if they aren't updated with every code changes. Therefore you should avoid commenting as much as possible. Clean code is self-explanatory. If you do have to make comments, then you should feel bad about it. ;)
Source: "Clean Code" - by Rober "Uncle Bob" Martin.
+ 3
It helps you to understand your own program after a while or to a second person.
+ 3
To inform other programmers what your code is doing so they can make adjustments as needed.
+ 3
to help
like I am commenting to help you