shlogg · Early preview
Samuel Ko @samuelko123

5 Reasons To Review Your Own PR Before Submitting

Reviewing your own PR? Don't miss these 4 key steps: Eliminate stupid mistakes, Enhance readability, Improve code quality & Ensure commit history makes sense. Your reviewer (and yourself) will thank you!

Once upon a time, a developer created a PR and requested for review.
Little did he know:
❌ He misspelt a variable name.
❌ He forgot to remove a console.log("testing").
❌ He overlooked a // TODO: refactor this code.
As such, it took several rounds of review to get it across the line.
Had he reviewed his PR first, he could've avoided this disaster.

  
  
  What is a PR?

A PR is basically a request of "May I put some code changes into your branch?".
In a collaborated environment, the main branch is usually protected. It means that you need to create a PR and obtain an approval to contribute...