Better Coding: Clear and Concise Error Messages

Steven Bui
Geek Culture
Published in
3 min readJun 15, 2021

--

Photo by David Pupaza on Unsplash

What does “error: W1023" mean? Opaque generic error messages doesn’t help anyone. We’re in the software age where no one reads the documentation so it’s bizarre to expect someone to look up an error code. When was the last time you looked up a phone number in a phone book?

Error Messages

Error messages are used to debug issues within the software. Some of these error messages are meant for users to resolve issues while others are used by developers to locate problems within the code. Either way, error messages should be human readable and help to explain what happened.

Often, it’s a tedious task to do for every little area of the code that could have gone awry. Developers take shortcuts by using error codes or generic messages in order to avoid thinking of error messages. It’s worth doing it correctly because it saves people time in the long run where the user doesn’t have to call the support line to get help.

Error Codes

Error codes are outdated relics of the past for software that requires an instruction manual. It’s easy to avoid creating error messages by putting error codes in their place but it creates a difficult to recognize error and wasted time to look up error codes. The other reason to use an error code is the resolving the issue is…

--

--

Steven Bui
Geek Culture

👨‍💻 Software Developer 👨‍🏫 Engineering Leader 🕵️‍♂️ Problem Solver