问题描述
这是我写的 javadoc,这是记录文档的正确方式吗?如果是,有什么方法可以改进我的文档?
/**
* Description: with the dna sequence provided the each letter will be check if
* the strand is a C. If the strand is C it will keep the amount and record of how many are
* in the Sequence
* pre: needs the dna sequence
* @param string
* post: the amount of c in the sequence
* @returns int
*/
我了解文档有多种格式。
解决方法
原创
/**
* Description: with the dna sequence provided the each letter will be check if
* the strand is a C. If the strand is C it will keep the amount and record of how many are
* in the Sequence
* pre: needs the dna sequence
* @param string
* post: the amount of c in the sequence
* @returns int
*/
修改
- 您不需要在描述前加上“描述”。预计您将要编写的内容描述了该函数的预期用途。我绝对能理解为什么你会惯性地认为包括这个。
- 语法可以改进; '每个字母都将被检查',不会让这感觉像一个专业的javadoc。如果英语不是您的第一语言,那么学习第二语言真是太好了!我们可以改进这一点!
- 我可能是错的,但由于描述/前/后,感觉你可能来自 QA/测试背景。如果是这样,很好地描述了这个,这包含了你需要的一切,但格式有点不对。我们可以解决这个问题!
- String 不是描述性参数,可以将其称为“序列”之类的东西。
/**
* Calculates the occurrences of the DNA strand 'C' in the sequence provided.
*
* @param sequence the sequence of DNA which may or may not include
* one or more occurrences of the expected 'C' DNA.
* @return the total sum of occurrences for 'C',if any. Zero may be returned.
*/