 Let's talk about commenting programs. Comments can serve three purposes. They can tell what the code does, how an algorithm works, and why the code is doing something. Let's look at some code with comments that, unfortunately, aren't very good. First, there are no comments at the beginning of the program to tell us what its purpose is. This is a place for a what comment. Namely, this program will demonstrate the basic use of the calendar class by creating a calendar, extracting the day, month, and year, and printing them. In the body of the program, all of the comments are what comments, but they restate what the code already tells us. Let's improve on that. First, take a look at this line. We can change this to a what comment that's more meaningful by telling what an instance consists of. Namely, a calendar instance will get the current day and time. This comment doesn't add anything to the party. Let's just get rid of it. The same applies to this line. It's not telling us anything new. This comment duplicates what the code says, but we don't want to get rid of it. Instead, we want to tell the reader why we are adding one to the month, and this will take a little bit of explanation. Namely, calendar returns a zero-based number for the month, but we want to display months starting at one, and that's why we're adding one to the month. This comment, its duplication, out it goes. Finally, let's change this comment to add more information, namely, print the information in European format, day, month, year. And because I don't want lines that are too long, I'll move the comment up before the code. And now we have better comments in the code. To finish this discussion, let's look at some code from a project named Jubler, which lets you subtitle videos and see how it's commented. These comments are written in Java doc format, which you can read about in Appendix B of your book. The comments at the start of this class aren't very detailed, but this documentation of the constants does add to your understanding. At the beginning of each method, the author tells us in detail what the method does, what parameters it expects, and what it returns. Further down in the code, we have an explanation of what these assignments mean and how the algorithm works. One other thing you'll notice in this person's code is that they've commented all the closing braces to show which opening brace they're matched with. And this is something that can be useful to keep track of your nested logic structures. The most integrated development environments now have features that let you see the indent guidelines, which I've turned on here. You can see the lines after this four that will line up with the closing brace to help you keep your code in line. The big takeaway from this video is to make sure that your what comments don't duplicate the code and that you include how and why comments to help people who read your code understand it better.