Skip to content

Instantly share code, notes, and snippets.

@KengoTODA
Created April 28, 2015 14:44
Show Gist options
  • Select an option

  • Save KengoTODA/a09bdc436c092e44521d to your computer and use it in GitHub Desktop.

Select an option

Save KengoTODA/a09bdc436c092e44521d to your computer and use it in GitHub Desktop.
my thinking about javadoc
Javadocでないコメントは、基本的に意図(WHY)を残すためのものだと思ってください。
意図以外の情報、例えば何をするものか・何が引数として必要か・どのような順番で
行うか、といった情報はすべてコードで表現できます。コメントは、これらでは補えない
意図を後に残すために使います。
なおコミットコメントも同様に意図を残すものですが、こちらは主に変更の意図を書くための
ものです。ただ、変更が大きい場合はコミットコメントに変更内容(WHAT)を書くこともあります。
Do NOT copy-paste javadoc. You should be responsible for your implementation.
You should know that each line in your commit are 'business decision'.
Think more severe and code quickly.
I think Google Guava is well documented project, please reference if you like it.
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/io/Closeables.html
* When you get number as argument, please explain 'which value you accept', 'zero-based or one-based', 'inclusive' and 'exclusive'.
  String.substring(int, int) would be good example: its javadoc tells 'inclusive' and 'exclusive'.
  http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#substring(int, int)
  List also be good example: it explain that its index is zero-based.
  http://docs.oracle.com/javase/6/docs/api/java/util/List.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment