I often find it helpful to use KDoc/Javadoc comments inside of a class or function instead of normal comments. IntelliJ colorizes them more obviously by default and, more importantly, allows hyperlinking to definitions. I'm wondering if it is considered bad practice to do so.
For example:
/**
* Standard kdoc comment here...
*/
fun saveUser(user: User) {
/**
* Save the user to the [UserRepository]
*/
userRepo.save(user)
}
In the inner comment, [UserRepository]
will be linked to the type definition for that class. This example is a bit forced, but I often find it helpful in read code.