Did you Check these in the pull Request?. Part 1

prasanna kumar
3 min readJul 17, 2023

--

No wonder code reviews pays the best interest in gaining coding knowledge. I see a lot of devs suffering from doing code reviews, especially the beginners. Not sure what should be asked to re work or just leave a suggestion. So with this post I had listed down few basic code review check list items which I believe that will fetch you some idea on code reviews and what should be looked at in the others code, so you can start your code review journey.

Does the code work (as much as you can tell by reading it)? Is the logic as written correct?

I meant, just look at the code, you don’t have to deep dive into any of the business logics, at the first glance if you feel something is not right and it is illogical. yup, you caught it. try to understand what they are trying to do, of course it is never a rocket science and I am pretty sure you can understand and if something is fishy, catch it right there

Are important checks (null check and other important validations) missing?

just the basic checking, something like using api data on html, so having an conditional check if the data is available then render the inner components, if a particular value is there before trying out some operation on it etc.

Do loops have correct exit conditions?

I mean why do you loop entire data if your requirement is already fulfilled? use break statements where ever required. This definitely optimises the performance and timing. And, this brings me up to add another point here.

Using apt methods

I see most devs even the most experienced using just a foreach or piping techniques to achieve something which is easily done by using the right methods. for an instance instead of piping a filter and map go for reduce on array methods. By just using the right methods you can greatly improve the performance of your application.

CSS changes need to be tested in all responsive form factors

it doesn't matter you have the same web application on a mobile app. responsiveness is important. literally. How many of you have opened a mobile app in a browser? At least in popular devices responsiveness should be done and this is never an extra job as a web developer and it is a part of it. Start from smaller devices and go for the bigger screens. so always ask for responsive screens in the review.

Is the code indented properly?

This sounds very basic and unimportant sometimes, but it is one of the most important items to be checked upon, how about working on a clumsy code to a properly indented code? hence it matters as a part of check list.

Do not pile the tech debts

It starts from saying “will be handled in next pr”. really? did you ever see doing the fixes on old code? once a tech debts, its always piles up and never shrinks, so never encourage one.

more checklist items will be in the upcoming blog.

happy coding ❤

--

--

prasanna kumar
prasanna kumar

Written by prasanna kumar

An obvious south Indian engineer

No responses yet