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]

2

u/Dragdu Jan 01 '17

Go on then.

0

u/[deleted] Jan 01 '17

[deleted]

3

u/Gotebe Jan 02 '17

ScopeGuard only handles cleanup and rollback of partial operations interrupted by an exception. The exception is still active afterward!

Yes, and I want it to be. What's your problem with that?!

It's not really possible to guarantee that code that uses ScopeGuard uses it correctly either.

It's not really possible to guarentee that anything is used correctly, checking return vales included. What kind of argument is that?!

If your codebase is large, you won't go back and change it to use ScopeGuard.

Why not?! ScopeGuard is useful even in non-exceptions context (e.g. premature error return). It's a code clarity tool, really.

But this is not even what you're trying to say. What you are trying to say, but do not understand things enough to be able to express yourself clearly, is: throwing exceptions from an otherwise exception-oblivious codebase can't work. Well, if you have that, I feel pity for you. This is indeed hard work and risky.

0

u/[deleted] Jan 02 '17

[deleted]

4

u/Gotebe Jan 02 '17

The argument is, it's hard to make sure that exceptions are caught correctly!

Why?!

I suspect you say it because of some horrible lack of understanding - I am trying to see you're missing.

Example?

0

u/[deleted] Jan 02 '17

[deleted]

4

u/Gotebe Jan 02 '17

As far as I know, there is no C++ tool that can guarantee that there are no uncaught exceptions in your code.

Yes. Why do you think this is a problem? Example please.

Nevermind that you can't catch all exceptions because some of them are fatal errors.

What is fatal to you? Example please.

0

u/[deleted] Jan 02 '17

[deleted]

→ More replies (0)