On the eve of “Double 11”, Alipay BASIC College held an activity named “Super Ma Force Contest”. This is a competition that only uses code to speak, and thousands of Alipay engineers participated in it. The programmers and program girls showed their pursuit of the ultimate code by writing and sharing the code, and thus depicted the picture of the most powerful Coder of Alipay — originality, perfection, inheritance and innovation.
We interviewed three Alipay programmers who won the Code Excellence Award, the Code Excellence Award and the Best CodeMan respectively to find out what they think is good code and what makes a great programmer.
Good code has commonalities
A thousand readers have a thousand Hamlets, a thousand programmers have a thousand ways of writing code, but good code must have something in common, and the three programmers also gave their own opinions.
“Good code, in my opinion, is something you can run, read, and enjoy.” This is a very systematic summary of good Code award winners.
- “Runable” is for machines. The basic purpose of writing code is to tell computers how to do things, so the code must be written right first. The concurrency issues we talk about, the security issues, the lack of exception handling, and so on, are all problems with the runable requirement.
- The second “readable” is for people, because code is read far more often than it is written. A readable piece of code, even if there are defects in performance and scalability, can be understood by others through better readability, and then solve these problems. On the other hand, some code is clever and efficient but unreadable, has a small audience, is hard to expand, and is easily discarded by history.
- The third is “to be appreciated.” The first two criteria are judged from a functional point of view, while “can be appreciated” is from an artistic point of view. Just as photos are meant to be written, but can also be made into art, so can code. Good code is prioritized, hierarchical, and enjoyable to read, like a novel, to see the author’s thinking behind the domain problem solving, the emphasis on risk, and the traces of elaboration.
In the opinion of Cherry, the winner of the Code Excellence Award, if there are only three words to describe excellent code, the first should be correct, the second should be readable, and the last should be performance.
Being right must be a top priority, because incorrect code doesn’t work and ends up being meaningless. Code is meant to be read first by humans and then by machines, and readability has the greatest impact on ensuring that others understand it and that the project is sustainably long term, and readable code is usually concise and elegant. Finally, performance is associated with the business, so early code performance is relatively unimportant.
Lian Ming, who won the title of the strongest CoderMan, summed it up as “readability, high stability and elegance”. In addition to the readability and elegance mentioned by both stack and Cherry, Lien Ming adds a high stability feature.
In his view, stability is a relatively rare code feature, because in addition to implementing functionality, stability also means consideration of technical risk, stability now and stability in the future when the business is rapidly expanding.
The code is readable, correct, stable, concise and elegant, which is the definition of excellent code by Alipay programmers.
Elder brothers lead the door, practice in the individual
What does it mean to be an engineer? Perhaps the words “Open” and “Share” can be explained a little. Alipay BASIC College has always had a “senior student culture”, many technical students’ first “introductory course” is senior student code, under the guidance of senior student, The technical students of Alipay constantly improve their technical strength.
Until today, He still has a deep impression on his elder brother Gongyu:
A large part of my preciseness in writing code was developed when my senior took me under his guidance. I remember that once we discussed with some other students in the group whether it was better to use Apache Beanutils or directly write getters and setters when converting VO, BO and DO. We discussed on a whiteboard for half an afternoon and considered various problems such as performance, defects and leaving posterity. The conclusion was that writing by hand was better. This and later group launched the “Alibaba Java development manual” happened to coincide.
A similar story happened to Lian Ming. Lian Ming, a beginner, developed the first iteration version for the first time and reviewed it to his brother. His brother only mentioned two points: was there any code formatting plug-in tool of Alipay installed before writing the code; Single test, code security scan is open. Lian was then confused. He later realized that the former stood for code format and specification, which were important for production. The latter is more likely to be ignored by technical students. The devil is in the details. If you fail to do these things well, there is no need for you to continue reviewing.
Cherry’s team is a newly formed team. Although he has not experienced the mentoring of his senior brothers, he has his own understanding of this.
There is a big lack of computer majors in China, that is, they do not produce programmers with the development ability that big companies need. Big companies need a lot of talented people who can write reasonable architecture, robust implementation, and readable code. Whether it is code competition or fraternity culture, they are filling a gap between the university and the company to act as a guide. Engineers need to have solid basic skills before they can gather together to do large-scale software engineering.
The senior students of Alipay taught the technical students their first lesson, sowing the seeds of craftsmanship and inheritance. Generation after generation of Technical personnel of Alipay have been striving for perfection and innovation in their respective positions, which is the Code culture of Alipay.
On the road to code excellence
“I started writing code for the production line in just over half a year,” he said.
After participating in the Super Power Contest, he felt that he had a good guide to his code values. As a technical person who is both a front-line developer and a Manager, an excellent programmer in his eyes must have independent thinking ability, be able to solve a problem independently, and be able to Cover the whole process from requirement analysis, design to implementation perfectly.
Lian Ming, who has been in the industry for more than three years, won the title of “the strongest CoderMan” this time, but he said that he did not dare to say the strongest, but he has the pursuit of the strongest forward. In his opinion, excellent alipay programmers have some commonalities:
- Originality. A good programmer is a good craftsman, working and communicating constantly, never satisfied, patient and professional.
- Inheritance. A good programmer should be a Master, not only strong himself, but also able to drive others.
- Innovation. Few people can truly innovate. Lian Ming also hopes that he can solve the pain points of Alipay business with an innovative idea and train of thought, and let technology drive business growth.
But attitude comes first, he argues, and without it, all this is meaningless.
Three types of excellent programmers are summarized in the stack: one is the implementation type, the implementation function is fast and good; One is the architecture type, which can quickly grasp the core and propose solutions when getting the requirements; One is creative, able to identify problems and propose innovative strategies and algorithms to solve existing problems. “I’m still trying to be an architectural programmer,” he says modestly.
When it comes to how to constantly improve their technical strength, the three also give their own views:
- Cherry said that what she missed in college was the cultivation of software engineering ability. She learned how to write readable code and how to design software through self-learning two good books, The Art of Readable Code and Complete Code.
- Pushing is about breadth and depth. Keep an eye on technical articles in your domain for breadth, and check out the Programming channels on Hacker News and Reddit for fragments. Deeply involved in large projects, he learned and improved himself by working with 10 times the programmers of NiUX. He mentioned that he was very lucky to have participated in a series of large projects in the platform of Fortune Technology Department and contacted many big cows.
- Lian Ming was very grateful for the platform of the Financial Core Platform Department, which gave him the opportunity to take charge of the core system as soon as he came in. He learned a lot from understanding a system, the business it carries, and the system and architecture of the whole line.
In fact, for the technical staff of Alipay, the original intention is to achieve the originality, perfection, inheritance and excellence of the code, to repay the business through technical strength, and ensure the stability and growth of the business.
In awe of every line of code and always thinking about it, the technical students of Alipay run madly on the road of pursuing excellent code.