Pair programming By: Li Yu & Li Yanan

Source: Internet
Author: User

start, end, and start

by Li Yu Li Yanan

This is the end of a seemingly lengthy, but short, pair programming project. In retrospect, there is a bit of sentiment and experience. So, let's start from the beginning, slowly aftertaste the drip.

Part 1first encounter pair programming, the little bit of it is really can say completely do not understand. Pair programming? How to do it? How to do it? What's the result? Everything, from the unknown. in the initial transition from individual projects to pair programming projects, you begin to experience the subtle benefits of pairing programming projects. The first is to look at each other's code with each other. (First of all, I feel that my partner is really strong) in the process of looking at the code, we began to understand each other's ideas, and began to clarify the other's ideas and methods of solving. Some places, we coincide, some places, she is better, some places, I may have some characteristics, some places, we are all flawed ... No one's code is born perfect, and no one's code is good, we all have advantages and disadvantages, we all have a need to learn and can be learned place ... We grow with each other in learning and discussion. The process of understanding the partner Code has a good effect on yourself. To me, in the process of understanding to understand their shortcomings, understand their understanding of the need to understand the lack of clarity, but also understand the different people for the same needs of different understanding ... In this process, I understand a lot. And all of this is just the start of pairing programming. We're just getting started. Part 2the opening of the code stems from a word-reuse. (I'm going to play my partner crazy today) the partner's personal project code is almost perfect, at least from the functional implementation, her interpretation of the implementation of the function is really a great inspiration to me. And her code is very extensible, in the personal project she has made the interface, but also for the subsequent operation more visible to her code extensibility, so we use the partner Code as the basis for reuse. In the process of reuse, we also recognize the importance and necessity of sub-modules to write code and to simply include content in a function. code reuse, in a nutshell, you write a function into a module so that when you need the same functionality again, you can use it directly without having to re-develop it. functions, inheritance, etc., are probably all using this idea. and code reuse, is also a prominent part of object-oriented programming, of course, is also the object-oriented and process-oriented programming of the difference between.  I'm a dividing line ?I was embarrassed by the opening of my teammate's business-to-peer, Qaq can only be embarrassed to move quickly to the point. first of all to talk about the code reuse, perhaps out of a PM intuition, personal projects do not require language, demand is also said to use the command line to complete the instructions, I still silently add to their needs, do the interface, but also choose a more portable Java language, so code reuse of the underlying project, My roommate and I decided to set up my project. In fact, in terms of code reuse , the first task of pairing programming--looking at the code, helps me a lot. Although not the same language with teammates, but the thinking is interlinked. Each function is encapsulated into a function, only in the main function, according to the process of invoking the functions of each function, the rest of the functions are almost no mutual calls between the module and the module, as far as possible independent existence. This is also my code do not very good point, in order to develop a convenient, I will be more functional division, the function of each sub-function is relatively complex, so that once a small functional requirements change, you need to adjust in a large module, the workload will increase, the error rate will increase. The way roommates are implemented follows the principle of high cohesion and low coupling, which is the benchmark we consider when code is reused. Code reuse is also reflected in the scalability and program intelligence, taking the individual project needs as an example, the requirement said, "a folder per account", I was in accordance with the user folder in advance to create, and then generate the paper after the address, stored in the folder to understand. And her code thinking I feel better, when preparing to generate the first set of test papers, if the user folder does not exist, then create, so that the extensibility is strong, when the user increased, or the need to change to the user table is not a preset, but through the registration generated, it will be easier to achieve much. This is what I learned in my teammates code and used in the end-to-end programming.  Part 3 briefly introduce the details of the program development.   ?development environment: eclipse+tomcat-7.0.85Development language: Servlet+html+css+js+mysql+ajax ?The bottom layer is developed by the servlet, and I have a plain understanding that the Java class that implements the Servlet interface is deployed to the Web server. the way HTTP requests are handled is httpservlet. If a GET request is called, the HttpServlet Doget method, such as a POST request, is called Dopost method.  front-end Html+css+js are now learning, from the interface arrangement to the event trigger, have gone a lot of detours, even the final code is very unprofessional, and did not fully implement the requirements of the document. Due to the first contact front, I did not use the framework, one is that may not have so much time to understand the various frameworks, the second is a few days of rapid skills, the original foundation did not play well, or hope to through this may not be able to do a perfect project to understand the basic grammatical structure.  It takes a long time to transfer data to and from the front and back, and here we choose to submit the forms and HTTP requests. The study of the online great God code found that Ajax may be the best method, but Ajax technology is associated with a wide range of knowledge, if the understanding is not deep enough, the design will be difficult, so the final balance, or for the long-booked holiday travel left a little time (the implication: less learning points). The real implementation of the process, the form of data submission is still difficult, the servlet layer can only request form data from HTML, and directly to the HTML interface, and can not pass a single form of data to the HTML, so there is the development process and the requirements of the document the largest access-the answer screen, Answer interface original answers submitted form and the title should be together, the results I think for a long time or did not find the use of Ajax communication, the data transfer to the browser method, only in accordance with the anti-human logic first done, pretending to adhere to the agile development, the principle of multiple iterations, eh!  compared to the front end, the backend implementation is relatively easy, do not do the database, only the question algorithm, POST request to send a verification code. Here is a brief introduction of the algorithm, the previous algorithm although the implementation of the logic of the problem, but the calculation is very difficult, so the reconstruction of the algorithm, considering the parentheses and operator priority, but also in the course of the problem will be the result step by step out. algorithm Description: 1, the problem in the process of generating the results, the main idea for the division of thought: if the sub-operation of the two sides with parentheses, then directly as a whole to solve the results of the operation, each small whole follow from left to right, the first multiplication after adding and subtraction algorithm. 2, algorithm improvement: On the basis of individual projects, the multiplication method is considered to be higher than the addition and subtraction of the actual situation, only the internal operator has a plus and minus when the parentheses appear. 3, the problem of rigorous consideration, the square and the root of the operator is more difficult to generate, so with ^2 and ^0.5 substitution, because of the existence of parentheses, it is easy to create ambiguity, so this version will ^2 and ^0.5 of the scope with parentheses;4, consider the problem of human nature, the junior high school difficulty and the operator of the difficulty of the occurrence of frequency = corresponding downward. 5, take the realization of the primary school topic generation as an example: Sir into the N (2-5) operand, put in the list, take two symbols and parentheses, and then take the two objects taken as a whole, re-put in the list to do the previous operation, until all operands are called a whole in the process of merging in parentheses to calculate the results, The last operation only needs to invoke the simple arithmetic function of the result class (following the first left and right, plus and minus principle) to complete. High school topics simply add the appropriate tertiary operator to the operator.  because the individual project made a simple UI interface, so the pair project does not want to keep the strongholds, so chose Javaweb, hope to learn something under pressure (here to relax, National Day in the various attractions to play when also worried about our project, almost thought to cool). In fact, this project still has a certain significance, because it is our first small Javaweb project, everything starts from 0 to learn. Unlike some of the previous paper Tigers, network programming is the kind of thing that sounds difficult and is not really easy to do. First of all, we need to design how each function is implemented, it is necessary to know what the front-end and back-end language we choose to achieve what, what kind of communication capabilities, so in addition to the reuse code written before the pure algorithm part-topic generation and calculation, the days before the National day (although only night) I understand these languages, Through other people's engineering cases, to infer what they can do, what they can call. Look at the feeling to learn more and more, so we in the edge of the cliff in time to keep their "perfect" demand, temporarily abandoned the database, choose a very low file storage.  close to 1000 kilometers from the pair programming, we also brought a certain trouble, because I have to go out to play during the day, the team members obviously back home, but also the big midnight and I "cloud" pair. Until come back, we two sit together debug only to find, extreme programming is how excellent, two people have special silly logic, collide with each other, can just hit off the bug.   Part 4 return to the fundamental, from beginning to end to recall the pair of programming in the drip, feeling that with a loss and harvest. As a weak code and not good at using the API, in the process of writing code encountered a lot of difficulties, many places are to find relevant information and look at the online blog of the Great God wrote to a little bit out of the solution, and part of the consulting partner to solve the understanding. In the face of meticulous project requirements and the complexity of the requirements of the point, initially really vacant, unfamiliar with the Java language, the HTML language is not understood, the Css,javascript language, want to make a web-based system, easy. From scratch, to complement the corresponding knowledge, through the search for information to solve various difficulties and problems. In a short period of time, to learn the language they do not understand, a project team has a lot of technical division of labor, two people have to undertake all the positions, from the requirements of documents, to design Web pages, from the point of demand, to the front and back of the writing. We have come a long way, at the beginning, at a loss, at the end of the joy.  Part 5 This pair of programming, some harvest is also some regret, the first knot on the project in the National Day holiday, and partner apart separation between the two places, communication with some local details and other code problems, and the meaning of the programming itself can not be well implemented and extended, The special nature of the holiday causes two people to not be able to complete the pair programming very well the need and the intention, the original intention did not obtain the good realization. Secondly, in the storage of user registration information, through discussion and access to information, probably reached three ways to solve, first, storage to the file, second, the use of the database, third, the use ofThe knowledge of the cookie is saved to the browser. And a partner for three different scenarioshas been discussed, because the database construction is more time and effort, and we just started the database learning, the operation of which is not very understanding, so the most efficient and common method can only be painful 割弃, andCookies are too cumbersome to operate, so they can only choose very low file storage. In the process of file storage, initially consider creating a folder under the specified path, which itself takes into account the ios system running on the situation (at our TA's little sister's reminder suddenly found that there is a case of Mac), However, in the access to the data found that the relevant information is almost 0, as well as to the Mac and other computers do not understand, resulting in folder in MAC computer The code is not clear enough, so it can only be created in the root directory, the file is stored in a relative path instead of an absolute path, The stored results are theoretically stored in the computer, either in the context of the JDK or in the context of the compiler. Different computer possibilities, and after the code has not been written in MAC platform for testing,  Part 6 However, we are still learning a lot in the process of pairing programming and adding a lot of knowledge. And I also take the opportunity to learn more with partners, so as to master some of the project more knowledge. From the detailed writing of requirements documents, to the use of Axure RP, to the conversion of CPP to Java, from the PS design page and the general layout, to the use of Html+css+javascript combined to put it into practice, from learning some fine coding, etc. To consider the code of the normative and other cases of code format and annotation format, we have experienced a lot, I also from the internet and the Great gods, and their partners to learn a lot. Furthermore, we have learned about our future employment orientation from the beginning of school, we have learned about the various positions in a project team, but there is still no deep and practice-based understanding of their work, and we know the importance of the project experience from the beginning of school, but our participation in the project is still a minority, even if we join the teacher's lab , and is often the "hit-and-play" presence (except, of course, the inclusion of some community organizations). In this pair programming process, we start from scratch, all based on individual projects, or expand and refactor it, or rewrite it, or even rewrite it, but we can understand in detail several of the major research and development positions (testing aspects are not covered), can be based on practice to deepen understanding and impression, Really let oneself in "do high school", for own future development Foundation. Perhaps our future team project will be a better breakthrough, but we have to admit that this personal project, has been very sad, but also to benefit a lot of people. Perhaps I will be overthrown in the near future, but at least now I am convinced that this project will be the most deeply felt and most impressive project I have ever experienced during my college years. The cooperation between the two, mutual help, to each other to continue to learn, in the process of completing the project to constantly improve themselves, perhaps this is an end, but this project is also a beginning, perhaps its original intention is very simple, but in the process of implementation we harvest a lot, realize quite deep.

Pair programming By: Li Yu & Li Yanan

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.