Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

producing javadoc

 
dave mohammed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I want someone to comment off the following coding so that I can produce appropriate javadocs. Thanks. Here'e the coding:


[ December 29, 2005: Message edited by: Mark Spritzler ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by dave mohammed:
I want someone to comment off the following coding so that I can produce appropriate javadocs.

Are you serious?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems he forgot to add, "and I want it done, chop-chop!"
 
dave mohammed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I'm serious. I just want appropriate comments so that I can produce javadoc. Please help, thanks.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, No. We are not here to do your work. This is a place to learn. Have you tried doing it yourself? If so, what problems are you having?
 
dave mohammed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I did try to do it myself. I wrote some comments but they didn't sound too right. I did alot of research but still. I am trying to produce relevant comments so that I can produce the javadoc in the right way. I commented some parts but I ended up with complicated javadocs. I thought I would get someone else's solutions to try to learn and understand how they derived at their commented solution. I would appreciate if you can assist me in any way.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want some hints for writing javadoc comments, I'd recommend that you download the source to a well known Open Source Java project (Http://jakarta.apache.org has a bunch of them) and see what you like and dislike about the comments in that project.

Most developers don't enjoy documenting their own code, much less someone else's.
[ December 29, 2005: Message edited by: Ben Souther ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave, we don't do other people's work here, especially homework, so I have sort of commented your code so that you get the basics, but you will have to write your own comments and remove some of mine before you turn in your homework.

I only commented public methods that are not methods from an interface, which already has Javadocs. But I did in a couple of cases like actionPerformed.

So tell us what you have learned from my doing some of your work.


[ December 29, 2005: Message edited by: Mark Spritzler ]
 
dave mohammed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, it did help to an extent. I learnt that for each constructor and methods, I should provide comments to support what function it performs. I know I have to re-structure my coding to support Sun's java programming standards, so I'll take note of it. I am aware of what each method does but I am unsure as to the appropriate wording and context in which to implement it so as to produce efficient and effective javadocs. That's why I asked for another person's input. For instance, the actionPerformed method I believe is called to perform the binary and linear searches. The chekNext method checks to see if a linear search was chosen or a binary search was chosen, whether or not to perform calculations that calls the repaint method to output the actual linear or binary results. The class Seeker implements the interface Runnable, which creates a new ShellGame and performs calculations that either starts the searches or stops the searches. Am I on the right track? Please advise me or correct me where I was wrong. Thanks.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems by your last post that you want someone else to tell you what the code actually does. I didn't think you had written it to begin with, and now I don't think you understand it either.

I don't think this is a question of not knowing what to comment, but knowing what you are doing.

Please do not bring this kind of laziness to the advanced forum. If we had a forum where people can ask others to do both their work and their thinking for them, I'd move it there.

This thread is closed.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Dave, I think you are on track. The comments you just wrote about what the method does is very good. It doesn't have to be perfect.

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OH, and here is a good link that someone else mentioned and I want to add it to the bottom here.

http://java.sun.com/j2se/javadoc/writingdoccomments/

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic