Subscribe to PHP Freaks RSS

php[architect]: The Dev Lead Trenches: Reviewing Code

syndicated from www.phpdeveloper.org on March 26, 2018

On the php[architect] site they've shared an article from their latest edition of the magazine (the March 2018 issue) about reviewing code from the "Dev Lead Trenches" column (by Chris Tankersley).

Code reviews are one of the best ways to help a team ensure they’re writing the best code possible. In all of the jobs where we have done peer-lead code reviews, we have caught more bugs and had better discussions about code than in places or times where we just hammer code through the approval process. I know, I know; we all write beautiful, bug-free code, so why go through the hassle of a code review?

He starts with the idea of relating code reviews back to test-driven development. In TDD the architecture and quality thinking comes up front and with code reviews that same kind of thinking happens with the second (or third) set of eyes as the code progresses. He then lists out a few helpful tools for code reviews including GitHub/GitHub Enterprise's own pull request system and similar features in Gitlab. He ends the post with some suggestions for successful code reviews including "don't punish", "ask questions" and "have clear intentions" (avoid vague questions).