One of the good coding practices that I picked up

Arpit Bhayani

Arpit Bhayani

Nov 17, 2024 • 1 min read


One of the good coding practices that I picked up while working at Google is about writing helpful error messages.

Instead of simply stating the error, almost always, the error message also contains steps to resolve it, links to refer to, a quick shortcut to post questions to the internal question-answering platform, or at least the direction to look into.

This practice can be seen across all Google Products. Try integrating with YouTube APIs, and you will see errors that are not only verbose but helpful. This can also be seen for all GCP interactions, be it web console or CLI, where the error message contains a link to a document on how to fix the issue.

I have personally started using this practice every time I write code.

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses