• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about comments

 
Frank Liu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javadoc source documentation (5)
comments (5)
what the second comments mean?
Need I write comments in the methods besides javadoc style comments?
then are there any styles about the comments in the methods?
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what the second comments mean?

Those are the comments that clarify your code, as opposed to the javadoc. For example:


Need I write comments in the methods besides javadoc style comments?

Yes, if it helps to read the code.

then are there any styles about the comments in the methods?

Not sure what you mean by style, but here are some guidelines:
1. Do not comment the obvious. For example:

2. If you find that you must write a lot of comments, it indicates that your code is bad and needs refactoring.
Eugene.
 
Frank Liu
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OH,I see.thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic