7.30代码日记

来源:互联网 发布:淘宝试用规则 编辑:程序博客网 时间:2024/06/06 20:18

函数命名对仗

Tables Are Cool add/remove increament/decreament open/close begin/end insert/delete show/hide create/destory lock/unlock start/stop first/last min/max source/target get/set next/previous up/down get/put old/new

按照输入-修改-输出顺序排列参数
使用所有的参数
把状态或出错的变量放在最后
不要在子程序的参数用于工作变量
可以在接口中对参数的假定加以前缀说明