

Java技术
2005: 03 04 05 06 07 08
09 10 11 12
2006: 01 02
Asp.net
2005: 07 08 09 10 11 12
2006: 01 02

Java程序编码规范
所有的程序开发手册都包含了各种规则。一些习惯自由程序人员可能对这些规则很不适应,但是在多个开发人员共同写作的情况下,这些规则是必需的。这不仅仅是为了开发效率来考虑,而且也是为了后期维护考虑。
命名规范
定义这个规范的目的是让项目中所有的文档都看起来像一个人写的,增加可读性,减少项目组中因为换人而带来的损失。(这些规范并不是一定要绝对遵守,但是一定要让程序有良好的可读性)
|
byte[] buffer; |
|
byte buffer[]; |
|
SetCounter(int size){ |
Java 文件样式
所有的 Java(*.java) 文件都必须遵守如下的样式规则
|
/*** Copyright ?2000 Shanghai XXX Co. Ltd.* All right reserved.*/ |
|
package hotlava.net.stats;import java.io.*;import java.util.Observable;import hotlava.util.Application; |
|
/*** A class representing a set of packet and byte counters* It is observable to allow it to be watched, but only* reports changes when the current set is complete*/ |
|
public class CounterSetextends Observableimplements Cloneable |
|
/*** Packet counters*/protected int[] packets; |
|
/*** Get the counters* @return an array containing the statistical data. This array has been* freshly allocated and can be modified by the caller.*/ |
|
public |
|
public |
|
/*** Set the packet counters* (such as when restoring from a database)*/protected finalvoid setArray(int[] r1, int[] r2, int[] r3, int[] r4)throws IllegalArgumentException |
|
public |
代码编写格式
|
if (i>0) { i ++ }; // 错误, { 和 } 在同一行 |
程序编写规范
|
... |
|
FileOutputStream fos = new FileOutputStream(projectFile);project.save(fos, "IDE Project File");fos.close(); |
|
implements CloneablepublicObject clone() |
|
public void setPackets(int[] packets) { this.packets = packets; } |
编程技巧
|
class Colour { |
Swing
调试
性能
可移植性
Borland Jbulider 不喜欢 synchronized 这个关键字,如果你的断点设在这些关键字的作用域内的话,调试的时候你会发现的断点会到处乱跳,让你不知所措。除非必须,尽量不要使用。
参考资料