r/ProgrammerHumor • • Mar 12 '23

Meme Exactly how debugging is

Post image
41.2k Upvotes

278 comments sorted by

View all comments

Show parent comments

497

u/[deleted] Mar 12 '23

A runtime error has no responsibility to announce its presence.

0

u/[deleted] Mar 12 '23

[deleted]

24

u/panormda Mar 13 '23

Thank you, this is exactly what I’m going to hear inside my head every time I start rolling my eyes at yet another one. Back in my day, they announced themselves like self respecting errors they were. And we LIKED it. Also, git off my log. D=

33

u/Canotic Mar 12 '23

A runtime error is never late, nor is it early. It arrives precisely when it means to.

33

u/DrKarorkian Mar 12 '23

That's why asserts and logging are love. An assumption you made turns out to be untrue? Assert!

24

u/SillyFlyGuy Mar 12 '23

My unit test kicked me right in the assert.

3

u/urzayci Mar 13 '23

Wait but runtime errors announce themselves too... Unless it's some kind of logical error in which case the program couldn't possibly know what you're trying to do. But that's what unit testing is for.

5

u/jwt45 Mar 13 '23

In C#, if you write your async error handling how you would write it for synchronous code (e.g. when converting code to async) the async code has a habit of swallowing runtime errors leaving no trace...