Is `/** .. */` the only doc comments style availab...
# announcements
v
Is
/** .. */
the only doc comments style available? It's too verbose for single-line comments, see for example https://github.com/google/iosched/blob/master/model/src/main/java/com/google/samples/apps/iosched/model/Session.kt
e
Why would you need docs comments in your app? Libraries I get it, but why would you pollute your app code? Look at data classes of KotlinConf app — it is clean & clear: https://github.com/JetBrains/kotlinconf-app/blob/develop/common/src/main/kotlin/org/jetbrains/kotlinconf/data/Speaker.kt
v
e
A reasonable ask. I would have helped me, too. Please, file a http://kotl.in/issue
e
OH GOD NO.
There is no reason to
Tooltips shall be just smart enough to show regular comments
There is zero reason to force programmer to write an extra
/
.
I have tons of code with private functions that have one-line
// something
comments before them. It is great idea to show those in tooltips
v
why not? I find /** */ style noisy
afaik it’s used in kotlin because it’s used in java?
e
So, if you find it noisy, then why write
///
. Just write
//
and let the tooling be smart enough to show those lines in tooltips.
Why invent something new? Kotlin was specifically designed to be easy to learn for Java devs. Kotlin does not change what works well in Java without substantial reason behind it.
On a philosophical note. You only need KDoc comments when you write a library and plan to publish its docs online. Take a look at stdlib and other Kotlin libs. These docs are almost never one-line. I find multi-line comments with
///
extremely noisy. My eyes bleed when I read sources of C# standard library.
👏 1
v
hmm. Interesting 🙂 I'm a .net dev, never used java.
(to make it clear, I'm not a C# dev 🙂 )
e
I guessed that
v
e
That is I cannot help. This is just Java translated verbatim to Kotlin. It is not an idiomatic Kotlin code, which is clean and beautiful by design 🙂
v
:)