一、Java代码约定 
       语法告诉我们what code it is possible to write—what the machine will understand,而约定(style、conventions)告诉我们what you ought to write—what the humans reading the code will understand. 
       按照一致、简单的约定写出的代码,将是maintainable, robust, and contain fewer bugs.  
       为什么需要约定,Sun给出的原因有: 
- 80% of the lifetime cost of a piece of software goes to maintenance. 
 - Hardly any software is maintained for its whole life by the original author. 
 - Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly. 
  
  
编写Java代码常用的约定有两个: 
  
二、TIOBE Coding Standard Methodology和Jacobe 
 
  
  
see:http://www.tiobe.com/tpci.htm 
代码美化工具:Jacobe,缺省包含了一个完全按照Sun的代码规范的格式化配置文件。  
 
  |