throw with String

Ralf Ebert ralf at ralfebert.de
Wed Sep 15 12:50:11 PDT 2010


> Beside the organizational details, throwing RuntimeException all over
> the place is not very useful. You would have to support better pattern
> matching to make it bearable. Setting up an exception type hierarchy
> will pay off. Maybe scripting is the only exception but this is
> something Java is not the best choice for.

For errors that are supposed to be handled in code, exception
hierarchies and 'throw new MyException()' statements are perfectly fine
of course. But a fair share of exceptions thrown in Java software are
exceptions that can never be specifically handled. This includes
assertions and situations that can only occur because of programming
errors. For these, exception hierarchies are often declared without
need, because 'throw new RuntimeException' in considered somewhat in bad
style by some programmers (without much reason in my humble opinion).

Sorry for not noticing the 'project coin ended' message, I'll file a bug
report about the proposal.

- Ralf




More information about the coin-dev mailing list