I’ve reviewed close to 2000+ code review requests in my career. At this point, it’s as natural to me as having a cup of coffee. However, from a senior engineer to now an engineering manager, I’ve learned a lot in between. If I had to learn to review code all over again, this would be the checklist I follow (inspired from my experience) 1. Ask clarifying questions: - What are the exact constraints or edge cases I should consider? - Are there any specific inputs or outputs to watch for? - What assumptions can I make about the data? - Should I optimize for time or space complexity? 2. Start simple: - What is the most straightforward way to approach this? - Can I explain my initial idea in one sentence? - Is this solution valid for the most common cases? - What would I improve after getting a basic version working? 3. Think out loud: - Why am I taking this approach over another? - What trade-offs am I considering as I proceed? - Does my reasoning make sense to someone unfamiliar with the problem? - Am I explaining my thought process clearly and concisely? 4. Break the problem into smaller parts: - Can I split the problem into logical steps? - What sub-problems need solving first? - Are any of these steps reusable for other parts of the solution? - How can I test each step independently? 5. Use test cases: - What edge cases should I test? - Is there a test case that might break my solution? - Have I checked against the sample inputs provided? - Can I write a test to validate the most complex scenario? 6. Handle mistakes gracefully: - What’s the root cause of this mistake? - How can I fix it without disrupting the rest of my code? - Can I explain what went wrong to the interviewer? - Did I learn something I can apply to the rest of the problem? 7. Stick to what you know: - Which language am I most confident using? - What’s the fastest way I can implement the solution with my current skills? - Are there any features of this language that simplify the problem? - Can I use familiar libraries or tools to save time? 8. Write clean, readable code: - Is my code easy to read and understand? - Did I name variables and functions meaningfully? - Does the structure reflect the logic of the solution? - Am I following best practices for indentation and formatting? 9. Ask for hints when needed: - What part of the problem am I struggling to understand? - Can the interviewer provide clarification or a nudge? - Am I overthinking this? - Does the interviewer expect a specific approach? 10. Stay calm under pressure: - What’s the first logical step I can take to move forward? - Have I taken a moment to reset my thoughts? - Am I focusing on the problem, not the time ticking away? - How can I reframe the problem to make it simpler?
Code Review Strategies
Explore top LinkedIn content from expert professionals.
Summary
Code-review-strategies refer to the approaches and practices that teams use to examine and improve each other's code before it is added to a project. These strategies help catch mistakes, share knowledge, and make sure code is clear and maintainable for everyone.
- Share your reasoning: Include clear explanations and context when submitting changes so others can understand not just what you did, but why you did it.
- Break changes down: Keep updates small and organized to help reviewers focus better and provide helpful feedback more quickly.
- Follow up consistently: Respond to feedback and confirm changes to build trust and maintain a smooth workflow within the team.
-
-
In the last 11 years of my career, I’ve participated in code reviews almost daily. I’ve sat through 100s of review sessions with seniors and colleagues. Here’s how to make your code reviews smoother, faster and easier: 1. Start with Small, Clear Commits - Break your changes into logical, manageable chunks. This makes it easier for reviewers to focus and catch errors quickly. 2. Write Detailed PR Descriptions - Always explain the “why” behind the changes. This provides context and helps reviewers understand your thought process. 3. Self-Review Before Submitting - Take the time to review your own code before submitting. You'll catch a lot of your own mistakes and improve your review quality. 4. Ask for Specific Feedback - Don’t just ask for a “review”—be specific. Ask for feedback on logic, structure, or potential edge cases. 5. Don’t Take Feedback Personally - Code reviews are about improving the code, not critiquing the coder. Be open to constructive criticism and use it to grow. 6. Prioritize Readability Over Cleverness - Write code that’s easy to understand, even if it’s less “fancy.” Simple, clear code is easier to maintain and review. 7. Focus on the Big Picture - While reviewing, look at how changes fit into the overall system, not just the lines of code. Think about long-term maintainability. 8. Encourage Dialogue - Reviews shouldn’t be a one-way street. Engage in discussions and collaborate with reviewers to find the best solution. 9. Be Explicit About Non-Blocking Comments - Mark minor suggestions as “nitpicks” to avoid confusion. This ensures critical issues get addressed first. 10. Balance Praise and Criticism - Acknowledge well-written code while offering suggestions for improvement. Positive feedback encourages better work. 11. Always Follow Up - If you request changes or leave feedback, follow up to make sure the feedback is understood and implemented properly. It shows you’re invested in the process. -- P.S: What would you add from your experience?
-
Unlock the full potential of your data projects with regular code reviews. Here’s what you need to know about them: 𝗪𝗵𝘆 𝗥𝗲𝗴𝘂𝗹𝗮𝗿 𝗖𝗼𝗱𝗲 𝗥𝗲𝘃𝗶𝗲𝘄𝘀 𝗠𝗮𝘁𝘁𝗲𝗿 • 𝗘𝗻𝗵𝗮𝗻𝗰𝗲𝗱 𝗖𝗼𝗱𝗲 𝗤𝘂𝗮𝗹𝗶𝘁𝘆: Regular reviews ensure that code is not only functional but also clean and maintainable. They help in identifying potential errors early, saving time and resources in the long run. • 𝗞𝗻𝗼𝘄𝗹𝗲𝗱𝗴𝗲 𝗦𝗵𝗮𝗿𝗶𝗻𝗴: They create a platform for team members to share coding practices and insights, which enriches the team’s overall skill set. • 𝗜𝗺𝗽𝗿𝗼𝘃𝗲𝗱 𝗖𝗼𝗹𝗹𝗮𝗯𝗼𝗿𝗮𝘁𝗶𝗼𝗻: By regularly engaging with your team’s code, you build a deeper understanding of the project and foster a supportive coding culture. • 𝗣𝗿𝗼𝗳𝗲𝘀𝘀𝗶𝗼𝗻𝗮𝗹 𝗚𝗿𝗼𝘄𝘁𝗵: Receiving constructive feedback and discussing different approaches to problem-solving contribute significantly to your professional development. 𝗛𝗼𝘄 𝘁𝗼 𝗣𝗲𝗿𝗳𝗼𝗿𝗺 𝗘𝗳𝗳𝗲𝗰𝘁𝗶𝘃𝗲 𝗖𝗼𝗱𝗲 𝗥𝗲𝘃𝗶𝗲𝘄𝘀 • 𝗣𝗿𝗲𝗽𝗮𝗿𝗲 𝗶𝗻 𝗔𝗱𝘃𝗮𝗻𝗰𝗲: Take the time to review the code before the meeting, noting areas that need clarification or improvement. • 𝗙𝗼𝗰𝘂𝘀 𝗼𝗻 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴: Approach reviews as learning opportunities, asking questions to understand decisions and considering alternative solutions together. • 𝗖𝗼𝗺𝗺𝘂𝗻𝗶𝗰𝗮𝘁𝗲 𝗖𝗼𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗶𝘃𝗲𝗹𝘆: Deliver feedback that is specific, actionable, and focused on the code, not the coder. • 𝗞𝗲𝗲𝗽 𝗶𝘁 𝗘𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁: Aim for concise, regular reviews that respect everyone’s time and keep the project moving. • 𝗙𝗼𝗹𝗹𝗼𝘄 𝘂𝗽: Ensure that actionable feedback from the review is implemented to continuously improve the codebase. Regular code reviews help to increase the quality of your code base and foster an open team environment that supports continuous learning. Have you participated in code reviews in your data role, and what benefits have you observed? ---------------- ♻️ Share if you find this post useful ➕ Follow for more daily insights on how to grow your career in the data field #dataanalytics #dtascience #codequality #teamwork #careergrowth
-
I don’t think the main primary purpose of code reviews is to catch bugs. Most dev do. They’ll tell you reviews are about quality control. But I disagree. The most valuable part of a code review is knowledge transfer. Here's why: - Developers usually test their code before opening a PR - Most teams already use linters, static analysis, and CI to catch issues What teams do not do enough of is share why the code was written a certain way and capture architectural decisions so future engineers understand the tradeoffs On a fast moving distributed team it is impossible for everyone to be in every call or track every ticket. Code reviews become the last line of defense for distributing knowledge Here are 4 ways to make code reviews a knowledge sharing superpower: 1. Always explain the “why” behind your code, not just the “what" 2. Document architectural decisions either in the PR itself or by linking to an ADR 3. Summarize the PR in plain English so anyone can quickly understand what changed and why 4. If a decision was made in Slack or a meeting, record it in the PR so it is not lost
-
9 code review practices your team should follow to go from Good → Great projects. (these helped my team deliver 100s of projects without wasting hours fixing bugs) 🟢As a team: ➡️Establish goals and expectations beforehand: for example: + functional correctness + algorithmic efficiency + improving code quality + ensuring code standards are met ➡️Use code review tools Use: (GitHub PRs, GitLab MRs, and Atlassian Crucible). + easily track changes + streamline the review process ➡️Automate code checks: It will help you to: + find syntax errors + avoid common issues + reduce code style violations and potential bugs. 🟡As a reviewer: ➡️Start early, review often: do this to: + catch issues early + prevent technical debt + ensure that code meets project requirements. ➡️Keep reviews small and focused: you get: + an easier process + shorter turnaround time. + better collaboration in the team ➡️Balance speed and thoroughness: + do comprehensive reviews + but avoid excessive nitpicking ➡️Give constructive feedback: always be: + specific, actionable, and respectful + focus on improvement rather than criticizing. + make a space for open communication to answer questions & give clarifications. 🟠As a reviewee: ➡️follow up on feedback: + don’t take the comments personally + actively work on feedback after the session + make necessary revisions and follow up to confirm ➡️Follow coding standards: focus on improving: + readability + maintainability Remember - mutual respect during the code reviews is crucial for a great team culture! – P.S: If you’re a Sr. Software engineer looking to become a Tech Lead or manager. I’m doing a webinar soon. Stay tuned :)
-
Tired of arguing with your coworkers during #codereviews? Why not start a Team Working Agreement with your #softwaredevelopment team? A team working agreement sets the ground rules for your team and how they review code. You should discuss and document key things like: 1. How fast should reviews happen? Agree on an appropriate turnaround times for reviews and state that in your TWA. Also describe what can be done if someone isn't adhering to the turnaround times. 2. What's our limit on PRs? Define PR size limits: whether that's roughly the amount of lines changed or a maximum on the number of files to be reviewed, a guideline can help keep a #pullrequest small. And remember: Small PRs mean faster, more efficient reviews. 3. Are you allowed to self-approve? Handle self-approvals: Can authors approve their own PRs? If so, when and under what circumstances? Are you making sure this won't be abused? 4. Determine whether you'll allow nitpicks. While I strongly suggest taking nitpicks out of the review (because most are subjective or can be fixed before the review), state if you'll be allowed to bring up nitpicks in a review at all. If you do, be sure to use the "nitpick: or nit:" prefix and explain what should be considered a nitpick. 5. What's allowed to block a review? Clarify what can block a #PR from being approved (and ultimately, merged into prod): Security issues? Missing tests? Missing documentation? Readability? Something else? The clearer your team is about blocking vs non-blocking issues, the fewer your debates will be during the #codereview. By drafting your own Team Working Agreement, you can start to make reviews less painful and more productive. And remember, you can always revisit this document and make changes as your team evolves. Just make sure you discuss and agree to the changes as a team! Get a TWA template in my book: https://lnkd.in/dKwGg667 And follow (theLGTMBook to be a better #codereviewer! https://lnkd.in/gJaDvkEu
-
+4
-
Last night, I was chatting in the hotel bar with a bunch of conference speakers at Goto-CPH about how evil PR-driven code reviews are (we were all in agreement), and Martin Fowler brought up an interesting point. The best time to review your code is when you use it. That is, continuous review is better than what amounts to a waterfall review phase. For one thing, the reviewer has a vested interest in assuring that the code they're about to use is high quality. Furthermore, you are reviewing the code in a real-world context, not in isolation, so you are better able to see if the code is suitable for its intended purpose. Continuous review, of course, also leads to a culture of continuous refactoring. You review everything you look at, and when you find issues, you fix them. My experience is that PR-driven reviews rarely find real bugs. They don't improve quality in ways that matter. They DO create bottlenecks, dependencies, and context-swap overhead, however, and all that pushes out delivery time and increases the cost of development with no balancing benefit. I will grant that two or more sets of eyes on the code leads to better code, but in my experience, the best time to do that is when the code is being written, not after the fact. Work in a pair, or better yet, a mob/ensemble. One of the teams at Hunter Industries, which mob/ensemble programs 100% of the time on 100% of the code, went a year and a half with no bugs reported against their code, with zero productivity hit. (Quite the contrary—they work very fast.) Bugs are so rare across all the teams, in fact, that they don't bother to track them. When a bug comes up, they fix it. Right then and there. If you're working in a regulatory environment, the Driver signs the code, and then any Navigator can sign off on the review, all as part of the commit/push process, so that's a non-issue. There's also a myth that it's best if the reviewer is not familiar with the code. I *really* don't buy that. An isolated reviewer doesn't understand the context. They don't know why design decisions were made. They have to waste a vast amount of time coming up to speed. They are also often not in a position to know whether the code will actually work. Consequently, they usually focus on trivia like formatting. That benefits nobody.
-
At my peak, I was landing an average of 5 code changes per day to prod. After over 1000 changes, I realized the bottleneck in landing code faster wasn't in writing it faster. The bottleneck is in waiting on code reviews. Here are 4 tips on how to get your code reviewed faster: 1. Break down your code - Each code change should have one main purpose. Breaking down your commits lowers the cognitive load for both you and the reviewer. This helps reviewers catch more bugs and review faster. 2. Build a bulletproof test plan - Thorough test plans actually save you time since your code will be accepted faster and you'll spend less time cleaning up breakages. For larger code changes, I like to include an E2E test, integration test, and rollout plan for my reviewers to comment on. 3. Preempt feedback - You know you're writing good code if you invite feedback yet receive none. Before you publish your code, reread it and preemptively address any feedback. This will improve your code quality and save you time in addressing comments. 4. Know your reviewer audience - Try to communicate what your reviewers need in less words. I often write a just sentence or two with the high-level motivation + a list of bullets about what this code change aims to accomplish. The easier the reviewer can understand the intent behind your change, the faster it will be reviewed. Anything else I missed that helps with getting code reviewed faster?
-
Code reviews are critical to an engineering team If you want to assess the health of an eng org The quickest way is look at the most recent Pull Requests (PRs) Over the last 7+ years, I became a better leader Just by leaning into and learning from my orgs’ PR review processes I learned that a healthy engineering org nails these 5 PR components : → Reviewers suggest inline code changes → PRs are reviewed quickly, < 24 hours is ideal → PR sizes are relatively small < 100 changes → Teams use a simple and fun emoji guide to share their feedback → Multiple teammates offer respectful feedback, not just the primary reviewer More recently I have been exploring AI-powering our PRs Both to speed up the review process, and also to improve the quality Modern AI tooling is able to provide some advantage like: 1. Stacked PRs: Allows developers to build upon open PRs without waiting for them to merge 2. Automated PR descriptions: Generates detailed explanations of changes automatically 3. CI failure analysis: Summarizes and even generates fixes for failing CI I am doing POCs with tools like: - Graphite.dev - reviewable.com - LinearB's gitstream & WorkerB framework to take over PR review process to the next level What are your current gaps with your own PR review process?
-
A common mistake of developers new to a "tech lead" role: trying to perform every code review. They're concerned that something will break if they don't. But reviewing every pull request isn't feasible, and doesn't scale. What to do instead? Here's what I've learned: 1️⃣ Enhance your delivery systems outside of code review. Strengthen your release pipelines with tests, monitoring and rollback. This will help to prevent, detect and mitigate defects. 2️⃣ Document code review processes. Team members should be aware of the expected size, scope and structure for each PR. Add automated checks for testing and approval. 3️⃣ Establish paradigms. Introduce design patterns and structure to the codebase, that others can leverage and build on top of. 4️⃣ Integrate automated tools. Use linters and formatters to ensure consistent style. Set up automated static code analysis. 5️⃣ Teach your team to review effectively. Emphasize the importance of kindness, clarity, and thoroughness. Identify when blocking is or isn't appropriate. 6️⃣ Be aware of what's going out. Slack/GitHub integration works well. Know when to scan a pull request, and when to do a thorough dive. You can't write and review all the code for your team. If you could, hiring others would be pointless. Instead: put your team in position to ship better software, faster. 🚢 #softwareengineering #codereview