前一个项目基本上算是完结。抽空总结一下这个项目的一些收获,以后写东西时候留心避免以前犯过的错误,吸取些许经验。

  1. 变量定义类型。自己添加的变量要注意类型。虽然可以参考程序已有的变量类型,不过还要通盘考虑自己变量的实际应用。比如这次,弄了个变量 String 类型,在前期确实很方便,但是后期就需要转 Int 型,比前期 String 用的还多……不想返工,只好 StrToIntDef(x,0) 的用,开销反而更大。
  2. 添加的函数要注意应用范围,不能添加一个函数实现了需要的功能而影响到其他范围内函数的功能。简单的方法就是添加函数时制定它的工作域
  3. 善用 Trim() 对字符串过滤。
  4. 标志变量要注意用完后返回初值
  5. 充分考虑判断条件组合可能带来的不同结果。
  6. 阅读程序的能力,程序已有同样功能的变量、函数不要重复制造轮子
  7. 注意已有的程序注释
Tags:

Related posts

Tags: .
Home

No Comments Now!

Be the first to comment on this entry.

Leave a comment

Name(required)
Mail (required),(will not be published)
Website(recommended)

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://hanghang.name),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.