Reading Notes:
1、You must handle every Exception in your code in some principled way.
(if you are confident that actually ignoring the exception is appropriate then you may ignore it, but you must also comment why with a good reason)
2、Don't Catch Generic Exception.
3、we don't use finalizers.(there are no guarantees as to when a finalizer will be called, or even that it will be called at all.)
4、import foo.Bar;
(Makes it obvious what classes are actually used. Makes code more readable for maintainers.)
5、When creating new components never use deprecated libraries.
6、Every class and nontrivial public method you write must contain a Javadoc comment with at least one sentence describing what the class or method does.
7、Write Short Methods
If a method exceeds 40 lines or so, think about whether it can be broken up without harming the structure of the program.
8、Fields should be defined either at the top of the file.
9、The scope of local variables should be kept to a minimum
10、Loop variables should be declared in the for statement itself unless there is a compelling reason to do otherwise
11、We use 8 space indents for line wraps
12、Non-public, non-static field names start with m.Static field names start with s.Other fields start with a lower case letter.Public static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.
13、Braces do not go on their own line
14、Each line of text in your code should be at most 100 characters long.
15、Use Standard Java Annotations
16、Use TODO comments for code that is temporary, a short-term solution, or good-enough but not perfect.
17、Log Sparingly
18、Follow Test Method Naming Conventions(testMethod_specificCase1、testIsDistinguishable_protanopia)

 

thanks

jack.lee

posted on 2014-01-07 15:01  jack.li  阅读(164)  评论(0编辑  收藏  举报