background:
currently working on a Java server project, all Controller,Service,Dao,Entity are required to write comments with standard Javadoc
@Controller
public class LoginController{
@RequestMapping(value = "/login")
public void login(String account, String password){
}
}
I think that for the above method, you can see what you are doing at a glance. There is no need to write comments at all, and writing comments is nonsense
but for the whole project, we need to write the whole code like this
/**
*
* @author xxx
*
*/
public interface LoginService{
/**
*
* @param account
* @param password
* @return
* @author xxx
*/
User login(String account, String password);
}
it is understandable if the whole project follows the specification. But most of the time, we only maintain the code, but not the comments , resulting in comments being misunderstood
so most of the time, I have a confusion about how to write the right comments , so that the comments do not become obvious nonsense, masking the real code intent. People who can quickly know the true intention of the code
do you have any good experiences, methods and techniques to share?