• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaDoc <code> or link?

 
Chris Bicnal
Ranch Hand
Posts: 96
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I'm finishing off my assignment and tidying up my JavaDoc. I've got a question for everyone out there though - how have you all formatted your JavaDoc comments?

I'm torn between using <code> and {@ } when referring to other classes in my comments. For example, I could reference JPanel by either <code>JPanel</code> which would put it in a different font or use {@ JPanel} which would provide a link to the JPanel JavaDoc page.

What have you guys done? When have you used <code> and {@ }? What do you recommend?

Thanks!

Chris
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, champ!

What I usually do is, if it's really important to see the other class in order to know or understand an API, then I use a link, otherwise I just use <code>. Also, if I use a link, I just use it the first time I mention the class in the text; the subsequent times, I use <code>. You may also consider using @see, and just use <code>... this is really a matter of choice.
 
Roel De Nijs
Sheriff
Posts: 10242
129
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roberto Perillo wrote:Also, if I use a link, I just use it the first time I mention the class in the text; the subsequent times, I use <code>.

I did it just like that. And I also used code-tags around null, true and false.

Kind regards,
Roel
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:And I also used code-tags around null, true and false.


Me too!
 
Roel De Nijs
Sheriff
Posts: 10242
129
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roberto Perillo wrote:Me too!

You know what they say about great minds
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic