문제 설명
스칼라의 변수 문서 (Variables documentation in Scala)
저는 Scala를 처음 접했고(Java 출신) 클래스 변수에 대한 문서를 생성하는 올바른 방법이 무엇인지 알고 싶습니다.
예를 들어 다음 코드가 있는 경우 :
class MyClass (bar:bar) {
val foo = bar
def function {
...
...
}
}
변수 foo
에 대한 문서를 작성하는 올바른 방법은 무엇입니까? 선언 직전에 주석을 추가하면 되나요? 좀 헷갈리지 않나요?
고마워요!
참조 솔루션
방법 1:
You can use Javadoc in Scala. But Scala also introduces its own documentation generator called Scaladoc. This is what is used to generate the standard language documentation.
In general, Scaladoc follows similar conventions to Javadoc but introduces new features. You can read more about Scaladoc comments style here.
방법 2:
There is no difference between java and scala comments. You can choose any documentation strategy you used in java.