Private methods documentation can only be seen by who has access to the source code. Is it worth the effort spent on it?
For private members (where you will actually do the work), you may want to document the purpose of methods. But it is much more useful to document your algorithms -- why and how, not just a description of the code. Any future developer who has access to your private members will have access to your code as well.
Nope, you shouldn't write javadoc for private methods. End users don't have access to private fields or methods so there really isn't a point in providing javadoc for them. Private fields and methods are only meant for the developer. If you really need to though, feel free to write comments for non-obvious logic.
Martin advises coders to always put member variables at the top of the class (constants first, then private members) and methods should be ordered in such a way so that they read like a story that doesn't cause the reader to need to jump around the code too much.
A private method has a body in an interface means that we can't be declared as a normal abstract method as usually do in an interface.
Personally, I feel that it is. Documentation is often the most useful to future developers maintaining your software - especially member documentation.
Even public API documentation is only of limited use to any audience other than a developer. Document for those following - they will thank you.
It definitely is. In anything but trivial software, you can make it faster to comprehend the code with the proper use of comments, even for the original author a few months later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With