0
Hey guys , why do we use "comment" command when it doesnt show it at all.
7 Answers
+ 4
I use it a lot to remind myself of stuff I'm working on, and as a summary for later reference.
+ 3
Imagine you have more than a 500 lines of code (which happens more than often) with no comments. There's no way u can find yourself when you want to bring changes to a certain function or script.
If your let you code uncommented for say 10 days without touching it, when you try to get back to it, trust me, it'll be total chaos for you to understand what u've written.
In addition, if you want to share your code without uncluding some comments as to what does what, people wont or a least will find a hard time to understand the way it functions.
So yeah my friend, take it as a good habbit to add comments. I'm not saying that you comment every sigle line, but at least add an explanation here and there from time to time. (Or from a function to antoherËË)
+ 3
Commenting is a way that you can leave comments within your code without affecting the code itself.
Commenting is also a convenient way to make code inactive without having to delete it entirely.
in Html You can start a comment with <!-- and end a comment with -->
in javascript you can comment on line with // or multiline with /* for start and for the end */
+ 2
So that people know what the code is talking about and they can comprehend your code better.
+ 1
Helps as a reminder of why you chose to do certain things at the time for when you come back to that piece of code days, weeks, months or even years later.
+ 1
As developer it is good practice to add comment in your code. Comment's helps you to understand purpose of any method or any line in code
0
thank u guys