0

Hey, I just started learning C++, and don't get what are comments. They don't show on the output, so what are they for?

9th Oct 2018, 5:04 AM
Tomer Yair
Tomer Yair - avatar
4 Réponses
0
How is it supposed to help others read the code, if it doesn't even show on the output?
9th Oct 2018, 5:27 AM
Tomer Yair
Tomer Yair - avatar
0
Say you are developing in a team, as an emoloyee for a company, or even by yourself on a large project. When you go back to look at that code it just looks like a big mess. Comments help you to remember where you are and why you did what you did in that block of code. For others it is a way to be able to understand your code and pick up from where you left off. Its our secret messages left for other developers or our future selves.
9th Oct 2018, 5:30 AM
Jarred Brown
Jarred Brown - avatar
0
oh, thanks
9th Oct 2018, 5:31 AM
Tomer Yair
Tomer Yair - avatar
0
no problem! Happy coding!
9th Oct 2018, 5:33 AM
Jarred Brown
Jarred Brown - avatar