Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javadoc Query

 
Phil Harron
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I'm just doing my Javadoc now for the UrlyBird 1.3.1 and was wondering should I write javadoc for every private method and field for each class?

The Spec says ...javadoc must be used for each element of the public interface..

Thanks
Phil
 
Eben Hewitt
Author
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know developers who passed with only writing comments for the public methods and constructors, when given the same instructions. So I would imagine that that would be okay.

I wrote Javadoc for private helper methods if their purpose or relation to the rest of the class wasn't immediately self-evident. But that was more for me, in case I wanted to refer to it later.

Eben
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Phil:
I believe javadoc is not required for private methods and fields, however it is good programming practice to document everything. It will make life much easier for whoever going to maintain your code.
 
Robert Konigsberg
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IN TERMS OF THE EXAM, It's probably helpful to document private methods because the concept is that the product will be passed along to junior developers. At least, that's the way it is on B&S.

RK
 
Ben Ritchie
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote javadoc for everything - although writing it was really boring
 
Jon Entwistle
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I played it safe and documented everything and enjoyed every second of it :roll:

Jon
[ July 22, 2004: Message edited by: Jon Entwistle ]
 
Matt Pryor
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another thing to bear in mind is that javadoccing up your code towards the end of the project lifecycle can be a really, really good way of refreshing your memory on how everything works and fits together!

Particularly if you do the assignment over a longish period of time.

[edited for spelling]
[ July 23, 2004: Message edited by: Matt Pryor ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic