Tips for Rewriting iOS Applications

I completed my Gap year and joined my current company in the autumn of last year.

As a newcomer, I didnโ€™t do much in the first month. There was a software engineer from AMAP with 10 years of experience. Every time I had a question, he would explain in depth and patiently guide me. However, at the same time, I also discovered that there were thousands of lines of copied and pasted code in the project. Yes, I counted using CLOC and found that there were nearly 20,000 lines in total.

Because Objective-C is a verbose and cumbersome programming language (meaning that you have to write dozens of lines of code to achieve the same functionality that might only require one line in Ruby ๐Ÿ˜ซ), the amount of code in this project makes sense. However, copying and pasting should always be avoided, and even worse, I saw global variables and magic numbers everywhere.

Isnโ€™t that strange? If a programmer with 10 years of experience can easily handle pointers and has a deep understanding of computer systems, why not pay attention to code style? After all, we need to be prepared for adding new members and new features to the team at any time.

He said most of the code was written by himself and bugs were fixed quickly. However, he left for a friendโ€™s startup company next month. So, he just left like that, along with the code from Anqu.com. ๐Ÿ˜ญ๐Ÿ˜ญ.

To be continuedโ€ฆ

Translated by gpt-3.5-turbo