Building a Code Review Culture at Tencent: Lessons from Rietveld, Google C++ Style, and Organizational Practices
This article recounts how Tencent’s advertising team introduced and scaled a rigorous code review process—starting with the Rietveld system, adopting Google C++ coding style, and establishing metrics and ownership—to improve code quality, knowledge sharing, and engineering efficiency across multiple departments.
In May, the author was asked by the internal code platform (code.oa.com) to share experiences from the advertising targeting team, which had achieved the highest company‑wide code‑review participation. The article opens with a memorable quote from a Google engineer emphasizing that code review is the key to Google’s code quality.
The narrative then describes the author’s early years at Tencent (2008‑2010) when code‑review practices were virtually nonexistent, and how the arrival of Google engineers in 2010 introduced the Rietveld code‑review system and Google’s C++ coding style. The team built the first internal Rietveld instance, standardized the style, and began reviewing code.
Yi Wang, a machine‑learning PhD from Google, enforced the style strictly, pointing out even minor violations and linking to the official guidelines. Over time, more engineers joined the review process, and three stories were repeatedly told to illustrate the value of strict standards, the cultural resistance at Google, and the aesthetic rationale behind the style.
When promoting code review within the team, three practical issues emerged: email integration with Outlook, poor Chinese support in the upload.py script, and performance bottlenecks due to text‑file storage. The first two were fixed by modifying Rietveld’s Python source; the third was later solved by replacing the storage backend with MySQL and moving from Django’s built‑in server to Apache.
In the advertising context, a “C++ readability” credential was introduced, requiring engineers to submit a review issue containing specific files (xxx.cc, xxx.h, xxx_test.cc) and pass a strict review before gaining the credential. This mechanism reinforced high‑quality standards.
After the 2013 merger of the search advertising platform into Guangdiantong, the team faced inconsistent legacy code and rapid product iteration. They mandated a transition to Google C++ style, enforced code‑owner approvals, and gradually expanded reviewer authority from directors to senior engineers.
Metrics were collected from code.oa.com to evaluate individual contributions: number of files changed, lines of code, review comments given and received. The author argues that transparent metrics aid fair performance assessment.
The article concludes with eight concrete benefits of code review—quality assurance, efficient communication, knowledge transfer, maintainability, compatibility with agile, social interaction, newcomer growth, and increased maintainability—and a set of actionable recommendations for building a code‑review culture, such as cultivating qualified reviewers, publishing style guides, establishing code labs, and implementing lightweight, well‑scoped review issues.
Throughout the piece, several images illustrate adoption statistics and system architecture, reinforcing the narrative of a successful, company‑wide code‑review transformation.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.