DEV Community

Discussion on: 7 Great Programming Quotes

Collapse
 
codemouse92 profile image
Jason C. McDonald

Unfortunately, that is neither the explicit statement, nor immediately clear to many readers. Taken as presented, many developers would assume they needed to suppress error messages.

Thread Thread
 
seanmclem profile image
Seanmclem

I don't agree

Thread Thread
 
nixonjoseph profile image
Joseph Nixon

I'm with you, while I can definitely see how someone could get the impression.
But the first thing I thought when I read this was that you need to plan for error states, but seriously attempt to avoid them.
While yes, as others have stated, users need to see errors when it's input or usage related, but the proper understanding of this quote applies there too. Because if the gui/interaction were designed properly, users wouldn't err. (some will always error, some are just dumb, others will try to break stuff on purpose.) there's no way to avoid all user errors, but you can definitely write code to account for all internal errors.
Its not about suppression, it's about prevention.

Thread Thread
 
codemouse92 profile image
Jason C. McDonald • Edited

I'd say the fact that yours is the fourth interpretation of the quote in this thread shows my entire point about the lack of clarity in the quote. ;)

With that said, I do agree with your position wholeheartedly, especially as it relates to a GUI.

Allow me to submit what may be a clearer alternative to the quote in question (although I'm hardly well-known enough to be quotable in my own right)...

Instead of writing better error messages, write better code that doesn't necessitate error messages.

Thread Thread
 
nixonjoseph profile image
Joseph Nixon

Well said! But while clearer, it doesn't quite a have the same ring ;)

Thread Thread
 
codemouse92 profile image
Jason C. McDonald

As a professional author, allow me to assert: clarity is better than brevity; but if you can get both, do.

Thread Thread
 
nixonjoseph profile image
Joseph Nixon

Now that's got a ring to it.

Thread Thread
 
codemouse92 profile image
Jason C. McDonald • Edited

Shrugs What can I say? You win some, you lose some.

Trying again...

Don't write better error messages, write code that doesn't need them.

Thread Thread
 
jeremycmorgan profile image
Jeremy Morgan

I like this better than the original.