This video features an interview with Shandor, an engineer at Spotify, who discusses his upcoming conference talk titled "Code Reviews: Building Better Code and Stronger Teams." Shandor shares his journey with C++, initially disliking it before embracing deeper learning through mentorship and blogging. The discussion focuses on the dual benefits of code reviews: improving code quality and fostering stronger team dynamics. He emphasizes the critical "human side" of code reviews, advocating for constructive, well-explained feedback, the importance of tone in written comments, and the role of reviews in mentorship. The interview also touches on practical aspects like managing reviewer load, using tools (including AI like Copilot as an assistant, but not a replacement for human judgment), and the continuous learning process derived from code reviews.
Code Reviews: Building Better Code and Stronger Teams - Interview with Shandor
0:00:02 Introduction to Shandor: Shandor, an engineer at Spotify (previously Emos for 10 years), shares his initial dislike for C++ which transformed into a passion for learning and contributing to the C++ community through his blog.
0:02:41 Overview of the Talk: His upcoming talk focuses on two main angles: how code reviews lead to writing better code and how they contribute to building stronger teams, emphasizing their tight connection for sustainable growth.
0:03:45 Code Reviews as Knowledge Sharing: He highlights code reviews as a great way to share knowledge, uplift team members with diverse backgrounds and experience levels, and address potential conflict or stress often associated with receiving feedback.
0:05:31 Constructive Review Techniques: Shandor explains how senior engineers should review from both low-level (variable names) and high-level (architecture fit) perspectives. Key takeaways for reviewers include making propositions, asking clarifying questions ("Have you thought about this?"), explaining the "why" behind suggestions, and providing external references for credibility and deeper learning.
0:09:16 Leveraging Templates for Efficiency: To save time, he suggests creating personal templates of common references and explanations, especially when working across multiple teams or repositories. Using Markdown for formatting comments is also recommended for better readability.
0:12:01 AI in Code Reviews (Copilot): While AI tools like Copilot are used at Spotify for automated code review suggestions, Shandor notes their initial low quality led to them being ignored. He finds AI useful as an assistant to suggest modern code rewrites (e.g., standard algorithms instead of raw loops) for personal code improvement before a pull request.
0:14:17 The Human Element and Tone: Shandor stresses the paramount importance of the "human side" of code reviews. He shares an anecdote about informal, joking comments being misinterpreted by external teams, emphasizing that written comments lack tone and gestures. Reviewers must carefully articulate feedback to be constructive and avoid misinterpretations, fostering a welcoming environment.
Tone Matters: The words used in comments are crucial as tone cannot be transmitted in writing (suggests future tooling like voice/video clips for comments).
Timeliness: Prioritize reviews, especially for senior team members, to avoid blocking others.
Explanation & References: Don't just state what to do; explain why it's better and provide references for further learning.
0:27:49 Code Reviews as Mentorship: Reviews serve as an excellent mentoring tool. Reviewers can guide by providing context and references. Authors (especially mentors) can proactively comment on their own pull requests to explain design choices, standard features, and provide learning resources for junior team members, which might not be appropriate for in-code comments.
0:31:11 Reviewer Selection & Load Balancing: In his experience, reviewers are usually not "picked"; it's a "free for all" system, typically requiring at least two approvals. This usually balances the load and allows various team members (seniors for architecture, juniors for detail-oriented issues) to contribute diverse perspectives and learn.
0:36:37 Personal Learning from Code Reviews: Shandor credits code reviews as a primary source for his fundamental C++ knowledge, including concepts like pass-by-const-reference, and discovering new standard library features. He emphasizes their value for beginners transitioning into programming.
0:38:55 Guidelines for Reviews: Advocates for automating style and static analysis checks. For human reviews, guidelines should focus on higher-level concerns like proper testing, security issues, and meaningful variable names, rather than stylistic minutiae.
0:42:39 Connecting to Team Culture: He relates his talk to previous conference keynotes emphasizing the "soft side" of teams, where a welcoming and positive environment leads to increased productivity and better results.