What is the Role and Impact of Comments in Code?
Hello again folks, And welcome to the second post that answers the question “How To Write Clean code?” and talks about the “good development practices”, which if followed, should produce “clean code” i.e. a clear code, well organized, and efficient. Which is easier to maintain and evolve, even if the development team changes.
If you have missed the first post, you can find it in this link
Recently, I came across the youtube video series “Clean Code — Uncle Bob” which is part of the “Coding Better World Together” a set of master lessons from the famous Uncle Bob (Robert Cecil Martin), where he gives a broad vision of the importance and future of Software in today’s society.
In the second lesson, Uncle Bob explains the purpose of comments in the code, breaking the idea that commenting code is a good practice and “has to be done”. For Uncle Bob, “writing a comment is a sign of failure since a good code must be able to explain by itself: Fewer Comments = Better Code.”