VISend JD
← Blog

Huy Bạch · 6 min read
  • Code review
  • Story

A five-line PR, an "LGTM" on a Friday afternoon, and how the way I review code changed starting that Monday morning.

7:05 on a Monday morning. My phone buzzed twice in a row. Not the alarm, but a message in the support group: "Hey, every reminder on our side is sending two notifications, is that a bug?"

I sat up, eyes still half closed, and opened my laptop. And I knew right away whose fault it was. Not the developer who wrote the code. Mine.

Friday afternoon

Three days earlier, around five on Friday afternoon, a tiny PR came in: let users change the time of a reminder. Five lines of code. Tests passing. A clear PR description.

I skimmed it, it looked reasonable, I typed "LGTM 👍" and hit approve. The whole thing took maybe two minutes. It was Friday, after all; everyone wanted to leave early.

What I didn't do was follow the flow. When a user changes the time, the code creates a new notification job. But the old job, the one created when the reminder was first set, was still sitting in the queue. When the time came, both ran.

Those five lines weren't wrong. They were just missing one line. And the person who had the chance to spot that missing line before it reached users was the reviewer.

About "LGTM"

Fixing the bug took fifteen minutes. What kept me thinking all morning was the word "LGTM".

I realized my review comments tended to fall into two kinds. Either "LGTM", meaning I hadn't really read it. Or "this is wrong, change it to this", meaning I read it, found the bug, and handed over the answer. The second kind sounds more diligent. But the outcome is almost the same: the developer fixes exactly the line I pointed at, and the next time a similar situation comes up, they still don't see it.

I can fix a line of code for someone. I can't fix the way they think.

Asking instead of ruling

The following week, I changed how I write comments. No more pointing out bugs. I follow the path the data takes, and where it looks like it breaks, I ask a question.

There was a PR from someone new to the team that also touched notifications. Instead of writing "missing deletion of the old job", I wrote:

When the time is edited, we still go through this function, right? Is the old job still there at that point? If it is, how many notifications does the user get? 🤔

Ten minutes later they replied: "Ah, got it, I'll fix it." Along with a commit removing the old job, and a test for exactly the time-change case.

I didn't point out the bug. They walked the flow again and found it themselves. And from then on, the question "is the old job still there?" lived in their head, not in my comment.

What came along with it

Asking along the flow brought a few other habits with it. I stopped writing "this might be slow", because that sentence helps no one. Slow for whom, when, by how much? I ask directly: what happens with the largest import the system has ever seen? The developer goes and measures it, no argument needed.

I split comments into three colors. Red means it doesn't merge until it's fixed. Yellow means it should be fixed. White means I'm just asking, and you may well be right. And I stopped blocking PRs over naming or formatting. Block over trivia a few times and the whole team becomes reluctant to open small PRs, and small PRs are exactly what make careful review possible.

Reviews are slower than before, for sure. Even a five-line PR now takes me ten minutes to read. But since that Monday morning, I no longer type "LGTM" at five on a Friday afternoon.

Contact

Looking for a Tech Lead?

I want to own the technical direction and help a team ship products that matter.

huybn.dev97@gmail.com