Why is comment actually made if it is ignored by the compiler ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is comment actually made if it is ignored by the compiler ??

2nd Feb 2019, 5:55 PM
Karan
Karan - avatar
2 Answers
+ 5
Imagine you're in a forest... When using a physical map(A paper one) noting the distance covered, leaving trails and making markings on the map is useful. Your code is the forest your markings, trails etc are the comments. In future it's easy to navigate the forest THAT'S HOW USEFUL COMMENTS ARE.
2nd Feb 2019, 6:21 PM
Cholasni Anaim
Cholasni Anaim - avatar
+ 2
If you're asking why a programmer would want to make comments even though the compiler ignores them, it's because they help document the code. If someone else came along and saw your code, or even if you revisited a code you wrote a year ago, it's helpful to have those comments explaining how it works
2nd Feb 2019, 6:03 PM
Zeke Williams
Zeke Williams - avatar