Why code quality is important? If a piece of code or a function works as expected (generating correct output) then shouldn’t it be considered good?
Well… No! This piece of code might be generating correct output but is it readable, reliable, secure, reusable, portable, maintainable, and optimal?
First and foremost is to develop an attitude or a habit to review the code.
The most important mindset for any development team to have is to think there will be mistakes in the code and hence it should be reviewed. This is the key to producing quality code because it opens up the form to review and discuss what can be improved.
Code review is a great way to analyze the code before moving the code to the “main” branch. The code review step should be mandatory for every “Pull Request” unless it is not evaluated on the defined set of rules it should not be merged. Below is a small depiction of the code review stage.
The reviewer should remember code review is not to find out mistakes in an individual. We all are humans and make mistakes. The crucial part is to ensure the code is reviewed and clear feedback is provided to ensure the developer can easily understand and make the correction.
So as we understand the importance and the agenda let’s understand the code review best practices.
Leave a comment