What Have You Learned?

In this chapter, you learned when and how to write helpful comments. This might seem so unimportant. After all, who cares about something that the compiler deletes?

In fact, it’s quite the opposite! Good comments can help you make your code base more readable and easier to understand. They can be a superb way of helping the future maintainer—that is, as long as you apply them only when they’re really needed and in a way that actually helps.

That’s why we started this chapter by going over when you should use comments and when you should get rid of them. You’ve learned that it’s always good to remove superfluous comments and even commented-out code. After all, the version control system won’t forget it. Now you can also ...

Get Java By Comparison now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.