Pair item: Arithmetic

Source: Internet
Author: User

Yu Fan: 155 && yellow on: 189

One, pair programming:

Xin Zou The teacher told us:

Http://www.cnblogs.com/xinz/archive/2011/08/07/2130332.html

There are two roles in pairing programming:

(a) the driver (Driver) is the person who controls the keyboard input.

(b) Pilots (Navigator) play the role of pilotage and reminders.

The two roles are interchangeable. Similar to real-life examples, a person is responsible for specific execution (driving, using keyboard editing programs, etc.), another person is responsible for navigation, inspection, cover, etc.

In fact, I personally belong to the Xin Zou teacher in the example of not like and other partners to write code, feel that a person to write a relaxed and comfortable will not have the trouble of communication. But in this one-pair programming also feel the cooperation is not the same charm. The advantages of the (official) pair programming:

(1) In the development level, pair programming can provide better design quality and code quality, two people can work together to have a stronger problem-solving ability.

(2) For developers themselves, knot-to-work can bring more confidence, high-quality output can bring more satisfaction.

(3) Psychologically, when there is another person in your side and you close cooperation, do the same thing, you embarrassed to wander, also embarrassed to fool.

(4) At the level of enterprise management, pair can communicate more effectively, learn from each other and transfer experience, can better deal with people flow. Because one person's knowledge has been shared by others.

In short, if used properly, pair programming can get a higher input-to-output ratio (Return of investment).

Now I'm just going to talk about my own gains and impressions in this pair of programming:

(1) Pair programming two people cooperate, in a sense prompted two people more actively into the program, the beginning of planning began to start programming discussion, as a procrastination patient, in this homework also quickly fix the main code, speed up the completion speed. Cooperation can inspire both sides to complete together.

(2) Cooperation has a multiplier energy efficiency, two people may be different from the treatment of some functions, and then through the analysis of two people to get a better plan and even on the basis of two people to discuss a good plan. The exchange of knowledge and experience has gained both sides.

(3) In the course of the work will encounter some of the temporary bugs wasted your time and fight your confidence, very often this time we will grumble or give up, we know that this reaction is not true so this time if someone to encourage you, you stick to it. This is also the charm of cooperation.

There are also areas where pairing programming is not very good:

(1) Pairing programming is suitable for partners who have the same working hours and work place. Otherwise two people have to cooperate with each other's time is a very troublesome thing, and if there is no way to face the exchange of many local text interpretation is not clear. It's quite difficult to understand.

(2) Pair programming does not fit two programming ability are not very good partners, not to do not want to do out of the finished product, just in the process of communication because both sides of the only level there is no way to have a good breakthrough or perfect.

Pair of partners: 13061189 Yellow on

Advantages: (1) Earnest (2) careful (3) effort (4) rationality (5) good at thinking

Cons: (We both share the mishap ...) ) Narrower knowledge

Second, the procedure analysis:

The uniqueness of the program may not be, but some of the advantages of being satisfied are still some.

(1) Although the UI design is very simple, but small and perfectly formed, the function can be satisfied. Use VS2012 's own interface design function.

(2) The main function is placed in a core class, inheriting the interface.

    public interfacevoid setting (int N, int R, int S, bool Fraction, bool bracket, bool MulDiv, bool negative); bool create (); bool Checkout (string Exer, string ans); string Calculate (string  F); } 

Each button on the interface corresponds to a function of the core.

(3) each function corresponding to the code is saved separately.

Core.calculate (): Calc

Core.create (): Create,expression, expressionlist

Core.checkout (): Calc

Three, the principle analysis:

1, information hiding (information hiding)

Information hiding is the foundation of structured design and object-oriented design. In the structure of the concept of function and object-oriented packaging ideas are derived from information hiding.

David Parnas The idea of a hidden message in the early 1972. In his paper, he points out that code modules should be encapsulated with well-defined interfaces that are internal to the programmer's private property and are not visible externally.
Fred Brooks in the 20 anniversary edition of the man-month myth, admitting that his criticism of Parnas was wrong. "I'm sure that information hiding – now often built into object-oriented programming – is the only way to improve the level of design," he says.
Application of some information hiding principles:
1. Adding interface layer between layers and layers in multilayer design;
2, all classes and classes are accessed through the interface class;
3, all data members of the class are private, all accesses are implemented through the access function;

(The above content from the blog http://blog.csdn.net/acloudhuang/article/details/6635230)

When writing object-oriented software or programs, to take into account the user's use of the problem, but also pay attention to their own code security issues, the use of this principle can be very good to maintain the problem.

2. Interface design (interface)

Clarity is the first step and the most important work interface. What is the effective use of an interface you design? People must be able to recognize what it is, why they use it, help them understand interface interactions, predict what will happen with it, and then successfully interact with it.

The best interface is not at all when we are able to manipulate objects directly in our world. Because this is not always possible, there is more and more information and objects in this world, and we create interfaces to help us interact with them. It's easy to add more interface layers, create overly-wrought buttons, chrome, graphics, options, preferences, attachments and other tedious stuff. So we finally manipulate the UI elements rather than the important things. Instead, pursue the original goal of direct manipulation, design an interface with as few footprints as possible and identify as many natural human gestures as possible. Ideally, the interface is very light, and users directly manipulate the objects they are interested in.

3, Loose coupling (loose coupling)

The basic concept of loose coupling is that it allows for changes or when the problem occurs at one end of the wire to avoid affecting other endpoints. In other words, changes or problems with the provider or service cannot affect the user-or the user's problem should not affect the provider or service.

For example, if a new version of the service is launched, the user of the service does not have to modify it, not have to change the route, or even have to go through stasis----because it (the new version of the service is launched) can clearly show them. In contrast, if a user of the service decides to change the provider they are using (possibly with a lower-priced service to choose from), this does not require the user application to be re-encoded or even interrupted to make such a change.

Loose coupling between program components can be achieved by using enhanced standard data type parameters. By customizing a data type or object, you need a component to define the knowledge of the data definition. Loosely coupled services can enhance critical data passing through the reduction of information to a single service.

Iv. Unit Test:

[TestMethod]public voidnew No2.cor E (); string exer =  " Exercises.txt "; string ans =  " Answers.txt "; bool re = Temp4.checkout (exer, ans); Assert.istrue (re = = true | | re = false); } 
        [TestMethod]         void TestMethod14 ()        {            new No2.expressionlist (3new No2.expression (11 ]. Equals (e)); }

(The above is part of the test code)

(For code coverage)

Pair item: Arithmetic

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.