Improving Code Quality - Session 57: Seeing Is Believing
Key point
During code review, you should examine the caller and callee code together to prevent duplication or omission of conditional filters.
Details
When early return code based on a specific condition is added during code review, it's important to check whether the same condition is also being applied identically elsewhere.
For example, if you add an isBlank() check to a message-sending function, you should review whether a similar filter already exists in the places that call this function or in the parameter conversion functions used internally. If conditions overlap or are missing, logical errors can occur.
To prevent this kind of duplication, in a statically typed language like Kotlin, it's effective to use null to clearly distinguish error types, rather than a separate object representing an error state.
For better reviews, it's recommended to take a 'Telescope' perspective review, using an IDE to look at the caller and callee of the changed code together with classes that play similar roles.
To check a GitHub Pull Request directly in your local environment, you can use the git fetch command to check out the relevant branch, which increases the accuracy of the review.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.