Code Review as a Team Discipline

The widely accepted norm for reviewing code is to raise a Pull Request, open for comments from the entire team. However, this does not bode well when people prioritize their own work over reviewing. Either the Pull Request awaits reviews for a long time, or is even merged without a proper review. The unending delay to review causes the developers, the overhead of context switching between features while the merge conflicts start to pile up....

April 23, 2021 · 2 min · Me

Knot-of-nots: Avoiding negative names for boolean methods

The usual convention to name methods that return boolean is to prefix verbs such as ‘is’ or ‘has’ to the predicate as a question, or use the predicate as an assertion. For example, to check if a user is active, you would say user.isActive() or to check if the user exists, you would say user.exists(). But when the intention is to check if the user is not active, I’ve come across code that is written as user....

December 21, 2020 · 2 min · Me

Code OCD

How does your room look when you have all your things cluttered on your table/shelf? How long will it take to find things from the heap of dump? Thats exactly how a codebase written with more than 25 lines of code in a function and methods not at the right place will look like. The code might run without errors and you might very well understand the code you wrote. But the quality of code you write should be determined by how well another developer can understand your code....

July 25, 2020 · 2 min · Me