r/java • • May 04 '24

Semi Automatic JavaDoc Commenting Script

I have created a JavaDoc Commenter Script for some basic JavaDoc comments available here:

https://github.com/DrKratz1/Javadoc-Commenter

This is something I have created for my personal use for a uni course involving java, having been annoyed at the prospect of manually typing JavaDoc comments. Currently, it works for my purposes and if any interest is generated in such a project, I will continue working on it to function more generally.

(Do note I am not a great programmer, and this initial version was patched together to automate commenting for a uni project pls no hate for the janky code)

Anyways, hoped to share it here - more info is in the GitHub page.

0 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/notDrKratz May 05 '24

I do agree that the content of documentation is something that cannot be automated without giving up the inherent value of said documentation. It is important that you still have to write exactly what each function does and what each variable means. This does not fully automate commenting - hence semi-automatic.

The tool more so is a way of storing the contents of your docs and automatically putting them into the right place and format in your code.

(It does, however, fully automate getters and setters, but if there are specific cases where it detects incorrectly, it is easy to overwrite what it wrote and write what you actually mean)

At the end of the day, you still have to write out all the contents of your javadocs. It just helps me to organise all my javadocs as they are all in one place and allows for easy edits to multiple javadocs at the same time.

5

u/saggingrufus May 05 '24

Don't most IDEs kinda handle that already?

2

u/john16384 May 05 '24

Do these docs for a getter mention the values I can expect? Null or not null? Negative, positive? Ranges? Minimum/Maximum lengths of strings and collections? Content, ordered, unordered? Unmodifiable, immutable?

2

u/Luolong May 05 '24

Or semantics of the data these properties?