现在的位置: 首页 > 综合 > 正文

代码规范

2013年05月10日 ⁄ 综合 ⁄ 共 758字 ⁄ 字号 评论关闭
  1. If
    a class is too big,it should be added comment and have documentation.
    If the arithmetic is too hard to understand ,i think it should have
    data flow diagram.(5 points)

    But if the documentation is too simple or no meaning,i don't think it should exist.

    Don't use too many depths if/elseif,divide it and use function.

    Format code before commiting code to cvs.

  2. variable name should be only single meaning .it shouldn't be ambiguity.(5 points)

    Because maintenance time is longer than coding time.

    i
    think that if the variable name is integer type,it can like this
    $iName,if variable is string ,it can be $sName,if the variable name is
    double,it can be $dName,if it is array type,it can be $aName,if it is
    sql resultset ,it can be $rsName;if it is a tree type,i can be $trName.

  3. Db Function and view Function should be separated.( 3 point)

  4. Try to use exist framework,don't create yourself.(1 point)
          Just Thinking

抱歉!评论已关闭.