Job Three: Code specification, code review, PSP

Source: Internet
Author: User

(1) Whether code specification is required

1. These norms are a waste of time in a bureaucratic system that wastes everyone's programming time and affects people's development efficiency. Against

A: First the coding specification includes the coding style and other specifications a team adheres to some specifications with many benefits!

(1). Follow the coding style to make the code easier to maintain

(2). Coding style makes the formation of code collective ownership (the role of collective ownership is very large, it can effectively increase the bus factor-a project can withstand how many programmers were hit by the car without affecting the normal operation of the project)

(3). Coding style can eliminate those long-standing disputes (you don't need to like this coding style.) If you don't like one of the rules, just yell at the document and lose your temper to the document, just as humans are angry at God. And then do things according to the agreement. It's more constructive, and it's much better than endless bickering about these unimportant things.

In short, coding specifications do not waste programming time, but instead make the entire software team more productive.

2. I am an artist, a craftsman, I have my own norms and principles. Identity

A: First of all, I think the shape of artists such people, should have their own principles, this is their unique character, that is, the quality of this character, determines their future development prospects! A good artist's good norms can affect many people even form a genre, such as the bold poet Su Shi, and Van Gogh's post-modern painting wind!

3. Norms cannot be enforced, and many exceptions should be allowed. Identity

A: For a problem, usually we can find more than 10 ways to solve it. For a solution, we can have millions of coding schemes to implement it. Everyone has to do their own coding style, as long as it does not affect the correctness of the code is not necessarily too tangled,

4. I am good at coding specifications, you can listen to me. Against

A: Familiarity with different coding specifications makes it easier for you to understand the entire code, which has a very important benefit to disseminate knowledge. In many development teams, each person is often responsible for a core module, and everyone focuses on his own module. Unless a colleague's module affects their own programs, they never communicate with each other. The consequence of this situation is that only one person in each module is familiar with the code inside. If the person is on vacation or--if not--resign, others are helpless. With code reviews, at least two people are familiar with these programs-the author, and the reviewer. The reviewer does not know the program as well as the author of the program-but it is extremely important that he is familiar with the design and architecture of the program.

(2) Code review

Peer review : My companion is the Highland classmate, just my first code review, consult the information, peer review of the main purpose is to check the code is simple, there is no logic algorithm error, optimization and improve the code!

, the following is the code for the plateau:

#include"stdafx.h"#include<iostream>#include<time.h>using namespacestd;voidDemovoid)//randomly generated arithmetic{ intA,b,k;//random number M,n, Counta=rand ()% -;//Generate random numbersB=rand ()% -; k=rand ()%5; Switch(k)//random selection of four operations {  Case 1:cout<<a<<"+"<<b<<"="<<endl; Break;  Case 2:cout<<a<<"-"<<b<<"="<<endl; Break;  Case 3:cout<<a<<"x"<<b<<"="<<endl; Break;  Case 4:cout<<a<<"÷"<<b<<"="<<endl; Break; }}intMain ()//main function for loop count{ intI=1;//Number of CyclesSrand ((unsigned) time (NULL));//generate different random seeds for the rand () functioncout<<"30-way 100 within subtraction arithmetic problem:"<<Endl; while(i<= -) {demo (); //calling Functionsi++; }  while(true);}

Run:

The code is simple and runs without errors.

(3) PSP Records individual project time-consuming situation

Plan 3.
Estimate how long this task will take 3.
Development 7.5h
Demand analysis
Creating a design Document 0
Design Review 1 h
Code specification 0
Specific design 2h
Specific code 3h
Code review 1h
Test 0.5h
Report 1h
Test report 0
Computational effort 0
Summarize afterwards and propose process improvement plan 1h

Job Three: Code specification, code review, PSP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.