码迷,mamicode.com
首页 > 其他好文 > 详细

code review(互审)

时间:2017-03-24 21:54:02      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:public   system   new   ble   err   空值   pre   注释   ati   

搭档代码的评审

package Question;

public class Q2 {
    private int maxRevolution;
    private int Revolution;
    private int gears;
    private double dia;
    private String colour;
    private String state;

    public Q2() {

    }
    
    

    public Q2(int maxRevolution, int revolution, int gears, double dia, String colour, String state) {
        super();
        this.maxRevolution = maxRevolution;
        Revolution = revolution;
        this.gears = gears;
        this.dia = dia;
        this.colour = colour;
        this.state = state;
    }



    public int getMaxRevolution() {
        return maxRevolution;
    }

    public void setMaxRevolution(int maxRevolution) {
        this.maxRevolution = maxRevolution;
    }

    public int getRevolution() {
        return Revolution;
    }

    public void setRevolution(int revolution) {
        Revolution = revolution;
    }

    public int getGears() {
        return gears;
    }

    public void setGears(int gears) {
        this.gears = gears;
    }

    public double getDia() {
        return dia;
    }

    public void setDia(double dia) {
        this.dia = dia;
    }

    public String getColour() {
        return colour;
    }

    public void setColour(String colour) {
        this.colour = colour;
    }

    public String isState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
    
    

    @Override
    public String toString() {
        return "Fan [maxRevolution=" + maxRevolution + ", Revolution=" + Revolution + ", gears=" + gears + ", dia="
                + dia + ", colour=" + colour + ", state=" + state + "]";
    }



    public static void main(String[] args) {

        Q2 status = new Q2();
        
        System.out.println(status);
    }
}

1.类名没有规范命名,随意命名没有意义

2.方法的名称也是随意命名的

3.没有注释

4.部分定义的变量难以理解

5.实例化对象,没有设值,mian方法执行的语句为空值,没有意义

code review(互审)

标签:public   system   new   ble   err   空值   pre   注释   ati   

原文地址:http://www.cnblogs.com/krylova/p/6613501.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!