Generally, our team has accomplished all the task successfully from the beginning of the semester till now. However, we do not get all the achievements smoothly but with overcoming many challenges here and there.Among these challenges, the different coding styles of each member left the deepest impression on me. The coding style should not be a problem when there is only one person writing the code. However, the problem comes when merging codes which are written by different people with different styles.
Two weeks ago, I was assigned the work to merge my code with Sathish’s code together to submit for the CE2 (coding exercise two) for CS2103T. Initially, I thought it was a simple and easy task since we all had finished our part of codes and I did not need to do any additional work except putting them together. Unfortunately, it turned out that merging the code become a very heavy and time-consuming work for me. Sathish has the experiences to do software engineering before. Consequently, his code was well-commented and every variable had a proper name. However, due to the over-detailed information in his codes, I had to read every line like reading a story. It took me about an hour to understand all the methods and classes in his codes. When I began to put my code in, I found that I had no choice but to use his print method to display the results; otherwise I would have to write a new print method which would disobey the principle of software engineering. What was worse, I discovered that my code had already made out the best choices under the budget. Conversely, Sathish’s code made the selecting and separating solutions in the print method. I need to redo my selection so that I could make my code fit to his print method. Finally, the merging of code was finished. I had spent a whole afternoon doing the merging. Sadly, it turned out that it had not stopped yet. Sathish told me there was something wrong in printing the results. After communication with Sathish, I knew that I had misunderstood the meanings of his variables. Concurrently, Yukai pointed out a bug that the program could not take in the zero budget. After a hard time fixing these bugs, the work was eventually done.
It is very common and natural that different people will have different style in coding. However, when it comes to merging the code written by different people, there will be confusions which will lead to lots of problems. I have come out three solutions. Firstly, coordination is needed in pre-coding period. For example, we should standardize all the names of the variables and distribute the work properly. Secondly, communication is necessary. If we come across any confusion of the other’s code, we should communicate with him or her directly and immediately. Thirdly, the tolerance and patience are needed. We should keep in mind that with the tolerance and patience, we can conquer any difficulty.