Two people to write software first to code specifications, further elaboration is to code style specification and code design specifications.
Code style specification for pairs, the first thing to do is to unify the development tools, and then pay attention to the source file format, layout, line wrapping, appropriate annotations, naming conventions. That is concise, easy to read, no ambiguity.
Code design specification: for functions. That is, using simple constructors, preferably the default constructor, because simple constructors enhance ease of use, and for error handling. Include (logical and programming errors, set errors, corrupted data ...), and then add some appropriate error handling to the program, for exception handling. Not to be absolutely certain of the situation, do not swallow the anomaly. If you understand why the exception occurs in a specific environment, it is recommended that you capture specific types of exceptions. The best way to keep the call stack is to use an empty throw statement when catching and re-throwing an exception.
2 programmers, one set of devices, working together, analyzing, designing, writing test cases, coding, unit testing, writing documents, working equally and complementing each other. One person acts as the "execute" role and is only responsible for programming.
The last is the different stages and techniques of the two people's cooperation. In my humble opinion, the relationship between the two sides is the strongest, the most distinguishing factor is the efficiency gap between them. Many things can affect the efficiency of programmers, including their previous: background, personality, skills, experience, cultural background, domain knowledge, language knowledge, and so on. If we combine these together, we can draw "efficiency". There may be another way to think about "efficiency", the potential strength of their output, the speed and quality of programming.
Understanding of the fourth chapter of software engineering