• Gradient Ascent
  • Posts
  • 👍Effective Code Reviews: Unlocking the Hidden Skill...

👍Effective Code Reviews: Unlocking the Hidden Skill...

It's about a lot more than finding mistakes

This week, I’ve been thinking quite a bit about communication between developers and non-developers, and the specific form of code reviews. After all, code reviews are rife with opportunities for misunderstandings, conflict, and frustrations. But it does not need to be so. Here are three tips to make sure code reviews happen smoothly

Tip #1: Default to Humility

I use code reviews to learn how others think and code. And to grow. If something in the code seems wrong to me, it is often a mistake or an oversight from the developer. But it can also be a misunderstanding or lack of knowledge on my part. Framing my feedback as questions helps soften the blow. (And means I look less stupid if I am wrong).

Never assume you know. Never stop learning.

Don't say: "This is not the right way to do it."

Do say: "I don't understand why you are doing it this way, because..."

Tip #2: Help Them Grow

If there is room for improvement, it's tempting to explain outright what the better solution is. But providing mentorship is also about helping others make the solution their own. And that requires them working to reach it, not being force-fed it.

You learn by doing the thing, not by being told it.

Don't say: "This is the solution: ..."

Do say: "I think you might be able to improve the code. Have you thought about..."

Tip #3: Share the load

Code reviews should not be in one single direction. Being on the receiving end of a review helps me understand what I can improve: not just how I code but also how I review. It requires setting aside my ego, which can be hard. But if you want to grow:

Don't restrict who can review your work

Do ask widely for feedback

You might have noticed a common theme in all three tips: choosing the hard path over the easy one. Choosing generosity and humility. This can be painful. It can be hard. But it is always rewarding. Or at least that is what I’ve found 🙂 

Found on the web

React Scan offers a one-line drop-in that highlights updated components in React, and gives you a quick and easy way to see if they are being excessively updated (which will slow down your application). It’s by the same outfit that released the “Million” React optimisation tool.

Framer and Framer Motion used to be a confusing concept between the page creation tool (Framer) and the React animation library (Framer Motion). Framer Motion has now been spun off, open-sourced, and it targets more than just react.

Payload, the NextJS CMS that aims to take CMS marketshare from WordPress, has just released their version v3 that has been rewritten in NextJs, making the most of its (relatively new) server-side chops

That’s all folks

Thanks for getting all the way down here. Let me know what you thought of all this newsletter issue so I can better meet your needs via this very short survey or simply by answering this email!

David from Kodaps

Reply

or to participate.