Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+35 votes

When we are commenting/adding javadocs to our methods in a class, should we also have a description of what the class is as an overview?

asked in CSC285_Fall2018 by (8 points)

2 Answers

+18 votes

Yes, it's good to have a summary of the purpose of the class at the top. See Appendix B in the Skrien textbook for more information about Javadoc.

However, don't go overboard on commenting -- focus on writing succinct clear code with excellent variable and method names, so that your code doesn't require too many comments.

answered by (302 points)
+17 votes

I second what Stonedahl said. But I just wanted to note that I will probably do comments similar to how we had to do them in 212 (and how we're doing them in 370). I would suggest doing them as you go/when you finish a session so that your other teammates don't have to go through each line of code trying to figure out what your code is doing.

answered by (8 points)