Why to do the comment one thing ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why to do the comment one thing ?

because the compiler will ignore it and its of no use to type print hello world with a comment input because the compiler will not obey it. if the compiler obeys it then we are not supposed to write the cout input

4th Apr 2018, 5:55 AM
razz ali
1 Answer
0
Comments are for the human reader of the code. They are essential I'm making the code easier to understand, which reduces likelihood of bugs, and also makes the code more maintainable. Think of a maths book teaching you maths. Comments are like the author of the hook using words to describe the formulas in the book. Without that, you wouldn't understand. Similar for code. Even if only you will read your code, if you come back to it a year or two later, you would have forgotten what the code means. Example of commented code: https://code.sololearn.com/cDM7qLwpjK08/?ref=app
4th Apr 2018, 8:43 AM
Emma