nico.fyi
Published on

Advent of Pull Requests Best Practice - Day 17

Authors
  • avatar
    Name
    Nico Prananta
    Twitter
    @2co_p
Advent of Pull Requests Best Practice - Day 17

Yesterday I gave tips on what to pay attention to when reviewing a pull request and it was about validating external data source. Today I'm going to share another pointer to keep an eye on.

Developers often start coding by tackling the 'happy path', where everything works as anticipated in an app. However, the real world is rife with 'unhappy paths' that need addressing. Take, for instance, a function in a pull request that accepts a numerical argument representing a person's age. It's implausible for someone to be -10 years old, yet a user might input this number by mistake. As a reviewer, it's crucial to ensure the code accounts for such scenarios.

Consider another example: a piece of code in the PR loops based on a user-entered number. But what happens if a user inputs an astronomically high number? Could it crash the app? Such edge cases are often overlooked in development. This is where thorough pull request reviews become invaluable, helping to identify and rectify unhandled edge cases, thereby averting potential bugs.

📖 Early Bird Offer

Need more insights like this? Jump on our early bird offer and grab your copy for 40% less! This deal is flying off the shelves, so hurry! 🎉