Chapter 4 Exercises and Discussions

1. Cases and papers of pairing projects
There have been many studies on pair programming in academia and industry. Please read at least two related papers or papers and summarize them based on your own personal experience.
(1) Take it seriously
In my opinion, one of the most obvious differences between pair programming and personal programming is psychological. Because pair programming is a matter of two people, whether it is a pilot or a navigator, you need to have sufficient preparation for program design and implementation, otherwise it is easy to become one person writing code and the other doing nothing.
(2) Improve efficiency
  . The form of pair programming makes the code in a constant review process. Each piece of code is written by one person and checked by another person, which minimizes the possibility of bugs; the two communicate with each other and discuss the implementation method. When problems arise, they can complement each other.
(3) Learning from each other
  Pair programming is also a process of mutual learning. In the process of pair programming, the two will continue to discuss implementation methods, code styles or naming methods. The ideas of the two people can complement each other. During the writing process, they can learn the ideas and methods of the other party to solve problems, which is helpful for improving their own solutions. Questions and programming skills help a lot.

  1. The influence of personality on cooperation
    People are different. When cooperating with others, it is necessary to pay attention to the different ways of expressing opinions and thinking. Please see the online article on MB TI [Note 4], test and share the respective MB TI types, discuss how much different personality types affect cooperation, and how to deal with each stage of cooperation [Note 5].
    This is my test: http://www.apesk.com/mbti/submit_email_date.asp?code=223.73.241.5&user=16614475
    ISTJ

Quiet, serious, and successful through comprehensiveness and reliability. Actually, there is a sense of responsibility. Make decisions logically and move toward your goal step-by-step without distraction. I like to keep my work, home and life in order. Value tradition and loyalty.

ISFJ

Quiet, friendly, responsible and conscientious. A firm commitment to fulfilling their obligations. Comprehensive, diligent, precise, loyal, considerate, attentive to and remembering the little details of people they value, and caring about the feelings of others. Strive to create an orderly and warm environment at work and at home.

INFJ

Seek meaning and connections between ideas, relationships, matter, and more. Want to understand what motivates people and has a strong insight into people. Be responsible and uphold your values. There is a clear vision for how to better serve the public. Planned and determined in the achievement of goals.

INTJ

Innovative ideas and extraordinary drive in realizing their ideas and reaching their goals. Can quickly gain insight into the laws of external things and form long-term long-term plans. Once you decide to do something you start planning and continue until it's done. Suspicious, independent, and very demanding of the ability and performance of himself and others.

ISTP

Flexible, patient, and a quiet observer until a problem arises, he will act immediately to find a practical solution. Analyzing the working principle of things can quickly find the key crux from a large amount of information. Interested in cause and effect, deal with problems in a logical manner, and focus on efficiency.

ISFP

Quiet, friendly, sensitive, kind. Enjoy the current. I love having my own space and being able to work on my own schedule. Very loyal and responsible to their values ​​and to those who are important to them. Dislikes arguments and conflicts. Do not impose your own ideas and values ​​on others.

INFP

Idealistic, very loyal to their values ​​and to those who are important to them. I hope that the external life and my inner values ​​are unified. Curiosity is heavy, can quickly see the possibility of things, and can be a catalyst for realizing ideas. Seek to understand others and help them realize their potential. Resilient, flexible, and receptive unless it goes against their own values.

INTP

Seek to find a reasonable explanation for anything that interests you. Likes theoretical and abstract things, keen on thinking rather than social activities. Quiet, introverted, flexible and adaptable. Has an extraordinary ability to concentrate and solve problems in depth in areas of interest. Suspicious, sometimes a little critical, and likes to analyze.

IS P

Flexible, patient, practical, results-oriented. I find theoretical and abstract explanations very boring. Likes to actively take action to solve problems. Focus on the present, naturally unpretentious, and enjoy moments with others. Like material comforts and fashion. The most effective way to learn new things is through experience and practice.

ESFP

Outgoing, friendly and receptive. Love life, human beings and material enjoyment. Like to do things successfully with others. Work with common sense and practicality, and make it fun. Flexible, natural and unpretentious, and can quickly adapt to anything new. The most effective way to learn new things is to try them out with others.

ENFP

Passionate and imaginative. I think there are many possibilities in life. Able to connect events and information quickly, and then confidently solve problems based on their own judgment. Always need the approval of others and always be ready to give others appreciation and help. Flexible, natural and unpretentious, with a strong ability to improvise and speak fluently.

ENTP

Responsive, wise, with the ability to inspire others, alert and outspoken. Be resourceful and strategic when solving new, challenging problems. Good at identifying theoretical possibilities and then analyzing them strategically. Good at understanding others. Dislikes routine, rarely does the same things in the same way, and tends to develop new hobbies one by one.

ESTJ

Practical, realism. Decisive, as soon as you make up your mind, you will act immediately. Good at organizing projects and people to get things done and get results in the most efficient way possible. Pay attention to everyday details. There is a very clear set of logical standards that are systematically followed and expected to be followed by others. Be strong in implementing your plan.

ESFJ

Warm-hearted, responsible and cooperative. Hope the surrounding environment is warm and harmonious, and implement it decisively. Likes to work with others to complete tasks precisely and in a timely manner. Loyalty in every detail. Able to perceive the needs of others in their daily lives and do their best to help. Hope that you and your actions can be recognized and appreciated by others.

ENFJ

Enthusiastic, considerate of others, responsive and responsible. Great attention to the feelings, needs, and motivations of others. Good at discovering the potential of others and hoping to help them realize it. Can be a catalyst for individual or group growth and progress. Loyal, responds positively to both praise and criticism. Friendly and social. Helps others well in groups and has leadership skills that inspire others.

ENTJ

Candid, decisive, with natural leadership skills. Able to quickly see inconsistencies and inefficiencies in company/organizational procedures and policies, develop and implement effective and comprehensive systems to solve problems. Good at making long-term plans and goal setting. Usually well-informed, well-read, and likes to expand their knowledge and share it with others. Very powerful in stating their ideas.

  1. Whether there is a need for code specifications
    For whether there is a need for code specifications [Note 6], please consider the following arguments and refute/support:
    1) These specifications are generated under the bureaucracy, waste everyone's programming time, affect people's development efficiency, and waste time s things.
    2) I am an artist, a craftsman, and I have my own norms and principles.
    3) The norm cannot enforce uniformity and should allow many exceptions.
    4) I'm good at formulating coding standards, just listen to me. Code Review Checklist:
    Answer: 1) This view is not supported. Code specification is not a product of bureaucracy, but to increase the readability of code, to make code readable and maintainable. Writing code that conforms to code specifications will not reduce development efficiency. On the contrary, doing so can improve people's development and maintenance efficiency. When we first started writing code, the teacher told us to cultivate a good code style, not only for the convenience of reading and understanding in the future, but also for the convenience of others. Especially when working in a team, if everyone is free to use their own way, it will not only be difficult to maintain, but also unable to understand the meaning of the code. This delays the workload, wastes time, and reduces efficiency.
    It's like there are no rules and no circles. If everyone insists on their own code style and does not standardize, then when the code is handed over, there will be conflicts between each other's opinions and viewpoints. It will be more annoying. Much more time is wasted than when it comes to developing specifications.
    In view of point 1, it will definitely take time to formulate specifications. Before the project starts, everyone will discuss and decide with each other, which will definitely take up development time, but if you don't spend such time, you will meet two people in future problems because of the code style. If it is not the same, it is necessary to start changing the code to suit the overall program, which will outweigh the gains.

        2)观点2,不支持这种观点。编程的艺术不是从代码规范中体现的,代码的艺术更多的体现在算法设计、数据结构的选取等方面。符合一定的公认的代码规范只会为我们的代码添彩,不会降低代码的艺术性。我认同程序员也可以称得上艺术家,我们和他们的不同就是我们的艺术发挥在机器上。每个人都是不一样的,每个人都有自己的习惯爱好,就如同每一位艺术家手艺人都会用自己的方式在作品上留下属于自己的记号,但是很多时候不是独特才是最好的,有许多事并不一定有什么最佳答案,只要能解决问题的方法就是好方法。同样,规范风格有时候也谈不上是不是最好的,应用起来方便、高效,这就是好规范。
    
        3)观点3,不支持这种观点。每个团队都可以制定自己的代码规范,但是这也是要建立在一定的公认的基础上的。因为公认的代码规范之所以能流传下来,一定有他的道理,这样的代码规范符合人们对代码的认知,便于大家理解代码。国家政策也是根据地区不同制定不同的规则。代码规范也不是强制的全部一模一样。如果遇到一些因为代码规范不能解决的问题,那么就不得不变通了。对于一个团队而言,我们每个人都只是一份子没有谁是绝对的独裁者,因为合作所以我们要照顾每个人的风格
        4)观点4,不支持这种观点。一个团队的代码规范往往需要结合大家的意愿来制定,一些规范(比如大括号不换行和大括号换行的两种信仰……)不能仅听一个人的,而应符合大多数人的习惯。这种想法不仅仅是在码代码的合作时不能有这种想法,为人处世其他方面也都厌烦这种专制。
  2. Discussion on Code Review
    Xiaofei: Wow, so many cool C++ functions can’t be used, so what C++ should we learn? In order to prepare for the exam, I have already memorized OperatorOverload and Polymorphism by heart, so why not let me use it?
    Achao: We write programs to solve problems, not to "force worry about giving new words". These advanced language features are not forbidden to be used, but should be used carefully. Don't just write three or five classes, one Set one, and focus on whether you can solve the problem in a concise way.
    Xiaofei: With so many specifications, I don't even know how to write the first line of programs.
    A Chao: Self-review is also very important - put the code in front of you as if it was written by another rookie. Ask yourself the questions that you usually ask others, and that others will ask you, and you will find a lot of questions.
    Xiaofei: If the developers are very good, then the reviewers are useless. Maybe these reviews are just going through the motions?
    A Chao: Similarly, it can be deduced that if the developers are very good, then the testers are useless, and they are just going through the motions, just send them home. Dare we do this?
    Xiaofei: These specifications and suggestions are all trivial things. We want to make world-class software. Is it too petty to do these things?
    A Chao: First of all, world-class software can also lead to world-class problems due to small flaws. For example, we often hear about security holes and emergency patches. Secondly, software development is a social activity and has its laws. One of the rules is the "Broken Windows Theory". If team members see that their peers do not follow even some small specifications, should they strictly implement unit tests? Another member sees that this module doesn't even have unit tests, so he can modify it at will. In this way, the quality of the entire software can be imagined.
    A: First of all, world-class software can also cause world-class problems due to small flaws. For example, we often hear about security holes and emergency patches. Secondly, the development of software is a social activity and has its laws. One of the rules is the "broken window effect". If team members see that their peers do not follow even some small specifications, should they strictly implement unit tests? Another member sees that this module doesn't even have unit tests, so he can modify it at will. In this way, the amount of the entire software can be imagined.
    Totally agree with Mr. Zou's point of view. Code should be reviewed and specifications should be maintained.

  3. How hard is it to read someone else's code? We often complain that it is difficult to read other people's code. When we write our own code, do we consider how to make the code easier to read and maintain?

http://dhruba.name/2012/08/21/do-you-hate-reading-other-peoples-code/http://kb.cnblogs.com/page/192086/
Answer: Summarize the main points in the article:
Make code conform to tools
Stick to one naming pattern
Use assertions to document preconditions and postconditions
Don't abbreviate English words
The C standard runtime library is not very well designed. Don't copy it
Don't write "smart" code Understand
what programming language features are designed for, and use those features to do what they're designed to do, not what they can do

  1. Bad habit in pair programming - have you experienced it, how do you remind your peers to improve?

The informal two work closely together, but with little regard for personal hygiene and mutual respect. Before starting the collaboration, it came after eating a lot of garlic.
People who like to give orders always say to the person typing: "To the last line, put a back bracket, and then...". Instead of focusing on the solution and what to do next, he focused too much on some programming details.
The spelling corrector sits next to you and corrects every wrong character you type. Of course, he didn't have time to actually navigate.
The Hidden One just typed the code himself without telling anyone what he was doing. The navigator had to figure out the code on his own. There is absolutely no communication between the navigator and the implementer about what method to use, what design to choose.
People with big jumps like to do big jumps in the code so the navigator doesn't know where to go.

    答:1.在我实际的工作中,一般都是女生在一起,并没有过这些不拘小节的伙伴。个人的仪表是对对方的尊重,如果我的同伴真的这样,首先我会提出一起去外面咖啡厅工作或者讨论,这样一般就会适当得体一些,并且给他口香糖吃。

2. First of all, we must affirm the reminder of the other party, and then also propose to him that we should solve the problem first, and then correct these programming specifications together after a while.
3. It's like being reminded constantly when driving. Sometimes this is really worrying, especially many spelling mistakes are temporary mistakes and programming tools will automatically remind me. When encountering such a partner, I I feel that I should guide him to pay attention in other directions, and ask certain questions before programming, hoping to help pay attention. Let it focus on the code.
4. I used to be a project manager in the design of another course. I have experienced this. At that time, I was a sophomore, and there were not as many students with high programming skills as there are now. There is often a person in a group who is much more than others. Ideas and new technologies used are often confusing. The structure and code are also not well understood. At this time, it is not only the implementers who should make changes, but also the people who read the code. They should ask questions directly, let the implementers answer, and discuss and exchange opinions, and hope to comment in the programming.
5. When watching other people's programming, when modifying the code, because they are not familiar with other people's code, they jump and switch greatly when modifying, so that people don't know the current situation of the whole project. At this time, the implementer can be appropriately stopped, and the reason for the modification or jump can be discussed with him to clarify his thoughts.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325243921&siteId=291194637