You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, a number of methods is not or only poorly documented with javadoc, which makes it hard for others to contribute. This also applies to the map-matching repository.
I think what we need are is a javadoc convention (see also #774) that applies to all new contributions. I would suggest to adopt the javadoc rules from the Google Java Style Guide, which describe where javadoc is required.
In addition to where javadoc is required, we also need some agreement on how to write good javadoc comments.
Yes the code is not commented a lot. I think we should aim for speaking names, short (if possible ;)) methods that can be understood easily. We should break the methods into smaller methods where possible and assign speaking names to the methods, so it becomes clear what happens. This is basically the approach presented in Clean Code (by Robert Martin). I think most method comments are unnecessary, however some methods are rather complex, these are typically documented already.
Javadoc becomes outdated very fast. Usually with the next refactoring one has to fix the Javadoc anyway.
It's important to communicate what the code should be doing.
I agree. An additional criterion for good javadoc comments is for me that users of the API should understand from javadoc alone how to use the API. Often it is not sufficient to just roughly describe what a method does but to be precise about the preconditions, postconditions and side effects of a method. An example for good javadoc is the java.util package. e.g. ArrayList. It does fully explain how to use the API without giving implementation details.
Activity
boldtrn commentedon Dec 1, 2016
Yes the code is not commented a lot. I think we should aim for speaking names, short (if possible ;)) methods that can be understood easily. We should break the methods into smaller methods where possible and assign speaking names to the methods, so it becomes clear what happens. This is basically the approach presented in Clean Code (by Robert Martin). I think most method comments are unnecessary, however some methods are rather complex, these are typically documented already.
Javadoc becomes outdated very fast. Usually with the next refactoring one has to fix the Javadoc anyway.
stefanholder commentedon Dec 1, 2016
I agree. An additional criterion for good javadoc comments is for me that users of the API should understand from javadoc alone how to use the API. Often it is not sufficient to just roughly describe what a method does but to be precise about the preconditions, postconditions and side effects of a method. An example for good javadoc is the java.util package. e.g. ArrayList. It does fully explain how to use the API without giving implementation details.
IMHO, the best mindset for writing good javadoc is Design by Contract.
I would require that javadocs are updated with every pull request by the pull request author. This way javadoc never becomes outdated.
karussell commentedon Dec 1, 2016
yes, like information about thread-safety and if stateless.
Yes but still it can happen that when doing some 'global' refactoring a local javadoc could get meaningless or wrong.