【发布时间】:2017-12-23 08:36:29
【问题描述】:
我最近开始使用 Java 进行编码,我经常看到单个 <p> 标记用于分隔行。但就我的目的而言,我实际上并不想制作“段落”,而只是换行,因此阅读文档不会那么糟糕。 <br> 标签可以接受吗?
最后,我想出了 3 种适合该项目的文档样式。我会因为什么被杀?
-
在代码中看起来不错,但在查看文档时看起来很糟糕
/** * <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> */ -
在代码和文档查看中看起来很糟糕
/** * 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. */ -
在代码和文档查看中看起来不错
/** * 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. */
【问题讨论】:
-
就个人而言,我会将结果用于解释器而不是代码的最佳输出。但是,P 是一个容器标签,因此您需要
...
。对于 br,我会使用
。不过,您可以通过在标签周围添加换行符来使其对代码更友好。 -
<pre></pre>有人吗? -
不用问队友和用户吗?他们的意见似乎比 SO 更中肯。
-
(再次个人)不太喜欢在整个 javadoc 中使用它。 java.lang.Long#parseLong 很好用
-
希望
比
有一个有效的 html 代码(第一个已关闭)