Will someone kill me if I use in JavaDocs?
I recently started coding in Java and I often see single tags <p>
used to separate strings. But for my purposes I really don't want to do "paragraphs" but just line breaks so the docs won't be that scary to read. Are the tags <br>
valid?
Finally, I came up with 3 document styles suitable for the project. Why would they kill me?
-
Looks good inside the code and does not read the document well
/** * <p> Does highly important adorable things. </p> * <p> Not only helping fields in being suitable * for stack overflowing, but also loves cats. </p> * <p> Please do not call while there are * some elephants in the main class. </p> */
-
Looks awful inside code and document view
/** * Does highly important adorable things. <p> * Not only helping fields in being suitable * for stack overflowing, but also loves cats. <p> * Please do not call while there are * some elephants in the main class. */
-
Looks good inside code and document view
/** * Does highly important adorable things. <br> * Not only helping fields in being suitable * for stack overflowing, but also loves cats. <br> * Please do not call while there are * some elephants in the main class. */
+3
source to share
1 answer
Maybe the cleaner option uses <pre></pre>
(which preserves the formatting):
/**
* <pre>
* Does highly important adorable things.
* Not only helping fields in being suitable
* for stack overflowing, but also loves cats.
* Please do not call while there are
* some elephants in the main class.
* </pre>
*/
+4
source to share