Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [jgit-dev] Exceptions in jgit

> I think we probably agree to disagree generally

Definitely :-)

> None of that is really the fault of the Iterator API as such. If you
> need an exception-safe iterator, you can easily do so by creating your
> own.

Hmm.. who wants to use my own iterator instead of the standard one?

> The point is that there are a few interfaces (e.g. Runnable) which
> really should have had some form of exception on them (or Exception) so
> the specific issue of wrapping in an already existing interface doesn't
> come up.

Right, but they don't have it and we have to live with it.

> Yeah, and I'm not trying to convince you otherwise :-)

Some years ago I was convinced that checked exceptions were the way to go.
However, after seeing too much of code like this:

                                } catch (FileNotFoundException e) {
                                        // should not happen because we already checked this
                                        throw new Error(e);

I became less idealistic and more pragmatic.

> Incidentally,
> how long have you been programming in Java? Did you come over from a
> different language with exception support before?

I have been programming in Java for about 10 years. Before that I was
programming in C++ and Python. Plus some functional languages whose names
I mostly can't remember any more :-)


Back to the top