zoukankan      html  css  js  c++  java
  • source code study

    • "if it works, it's right" vs "it doesn't work unless it's right"
    • the objective that move all of the temp variable of any class in function block to class member is to inspect the relations of all of the classes .Include: Temp variables ,parameters ,etc ,for both direciton:UML<-->CODE.

     ----------------------------------------------------------------------------------------------------------------------------------------------

    • In the funciton block, the position where does variables definition responsed in variables name in my suggest . like prefix definition: g_ is a globle member , s_is a static memeber,m_ is a member , p_ is a parameter , t_ is a temp variable ,c_ is a const variable ,etc .
    • all the prefix can composite to together ,of course, some of them may be exclude .
    • cp_ stand for , this variable is const&parameter of the function .

      use if/else if to dispatch all of the posibility , if/else if cover all of the already-known condition , the last else is for the defaute or unknown condition process ,but not the last condition process .if there are three condition ,so it can be / must be like this :

      if(condition1){}

      else if(condition2){}

      else if(condition3){}

      else{}

      Can not write like this :

      if(condition1){}

      else if(condition2){}

      else{}// process for condition3 .

      make all of process explicity ,and do a helper for reverse-engin--he can known the three  condition only read this source code ,other wise he must read some document for the third condition ,if there is no document , he will be crazy .

     -------------------------------------------------------------------------------------------------------------------------------------------------

        If possible , logic process and pure data process write to different class . what is logic and how to recognize it ? if something belong to bussiness , it is logic ; logic orgnize data to meaning information .

  • 相关阅读:
    HDFS体系结构
    HDFS核心设计
    1)HDFS分布式文件系统 2)HDFS核心设计 3 )HDFS体系结构
    大数据的特征
    zookeeper原理
    Hadoop安装手册
    微信公众号开发
    一、Ajax 二、JSON数据格式 三、Ajax+Jquery 四、分页的实现
    设计模式--工厂模式
    Spring MVC 配置文件设置全局编码
  • 原文地址:https://www.cnblogs.com/Cmpl/p/2211226.html
Copyright © 2011-2022 走看看