From the course: Agile Software Development: Clean Coding Practices

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Comments

Comments

From the course: Agile Software Development: Clean Coding Practices

Start my 1-month free trial

Comments

- [Instructor] Comments are chunks of text that the compiler ignores when running a program. These chunks of code only have one audience, humans. This makes comments an incredible tool for communicating intent when writing a program. However, not every comment has the same value. The best comments answer why questions such as, why does this program exist, or why is the program implemented this way? The worst comments merely restate the code that it is attached to. Comments like this should just be deleted because they provide no value beyond the code itself. If you feel that some code is hard to read and that a comment is needed to make the code easier to read, then it's best to apply refactoring techniques to make the code easier to read instead. Another kind of comment that needs to just be removed is a commented out line of code. Commented out lines of code force the reader to wonder why the code was commented out in…

Contents