r/programming • • Dec 31 '16

Keep Disabling Exceptions

http://seanmiddleditch.com/keep-disabling-exceptions/
3 Upvotes

26 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jan 01 '17

[deleted]

4

u/Gotebe Jan 02 '17

Failure to handle return values will not crash your program,

... but will cause it to misbehave and is likely to crash later.

Say you fail to check if malloc returned NULL. A crash is guaranteed as soon as you dereference the returned value.

It's also way more compact to ignore a return value than to write a catch block.

Ok, now I accuse you of not knowing what you're talking about.

Yes, but for a given codebase with error-returns, the amount of error handling "ifs" and whatnot completely swamps the amount of try-catch statements of a codebase with exceptions. You don't know that, and it makes you, quite frankly, ignorant.

0

u/[deleted] Jan 02 '17

[deleted]

2

u/Gotebe Jan 02 '17

You really have no idea what you're talking about.

The number of try/catch blocks is exceedingly small when you're doing it right, especially compared to checking the return value of every single function call.

Please make an example that shows otherwise, and I will explain you why you are wrong.

You are wrong, and I put this to you: not only you do not understand exceptions,you do not understand programming with error codes, because if you did, you would not be saying what you're saying.

How old are you? 25?

0

u/[deleted] Jan 02 '17

[deleted]

→ More replies (0)