Hello everyone,
I joined Meta a couple of months ago as an IC5, coming from a predominantly Java background. Recently, I've started working with the PHP codebase, which is somewhat new to me. I've noticed that my diffs tend to undergo several rounds of revisions, which not only delays their integration but also consumes more engineering time than I'd like.
A fellow engineer pointed out that my diffs are often too lengthy, leading to extensive feedback and additional iterations. I'm actively looking for ways to streamline my review process and improve the quality of my submissions.
Here’s what I’m considering to reduce the review cycles and improve my coding approach:
I would greatly appreciate any advice on:
Thanks in advance for your help! I'm eager to learn from your experiences and improve my contributions to our projects.
This is one of the examples of classic Meta culture shock, so don't worry, many engineers have gone through this before and successfully come out the other end (I mentored many engineers through this).
Your teammate is right in that your diffs are too big. The good news is that once you start pushing more atomic diffs, you'll almost certainly find all of these code quality problems going away. Your overall strategy here should be to:
I made an entire course about this process (and more) which you can go through here: [Course] Level Up Your Code Quality As A Software Engineer
If you're crunched for time, you can start straight at the "Break It Down" section: https://www.jointaro.com/course/level-up-your-code-quality-as-a-software-engineer/break-it-down/
As for specific tips on transitioning from Java to PHP, I unfortunately don't have much. I also joined Meta with a Java background, but I didn't have to write much PHP as I do Android. Java and PHP are pretty different languages, and to be 100% honest, I think PHP is sort of a janky programming language. My advice is to be a feedback sponge in code review, identify patterns from experience, and just keep on improving. More thoughts here: "What is the effective way to understand new repository in order to make the required changes in that repo?"
Thank you for the suggestion, Alex. I plan to follow your advice and will keep you updated on how it goes.
This is not specific to the Java --> PHP transition, but my recommendation with any new language is to make many small changes. Try to make them independent of your main project, which will likely require larger changes and more thorough review.
Instead, make throwaway changes which are very small quality-of-life improvements, e.g. variable naming, fixing tests, etc. This has 2 big benefits:
How to apply the 'one diff, one thesis' to improve code reviews?
I've noticed that my diffs tend to undergo several rounds of revisions, which not only delays their integration but also consumes more engineering time than I'd like.
Here’s what I’m considering to reduce the review cycles and improve my coding approach:
- Reducing the Size of Diffs
- Pre-Review Checks: -- Any suggestions here would be great
Since you just started, your reviews will be under a lot more scrutiny, which is good since it'll prevent you from merging in bad code or causing any incidents.
Your suggestions about how to improve your PRs make a lot of sense. Opening smaller diffs can actually get your code accepted faster. It can be intimidating for someone to open a PR and see that hundreds or thousands of lines were changed. They might decide to look at the PR later in the day because they don't have the time to give it a thorough review in the middle of the day. But, if they see a smaller change that only takes 3-5 minutes to look at, they will be way more likely to close that loop immediately.
For pre-review checks, this will be less about the semantics of the code and more about being on the right path. A small explanation or bullet points about what you intend to do in your code change can prevent you from going down the wrong path and wasting a lot of your time as well as your reviewers' time. It will also help grease the wheels and get your review accepted faster because the reviewer knows exactly what to expect in the code review. There's nothing more demoralizing than someone blocking your review because the implementation is completely wrong.