On Thu, Jun 29, 2023 at 9:07 AM Gilles Sadowski <gillese...@gmail.com> wrote:
>
> Hello.
>
> Le jeu. 29 juin 2023 à 14:44, Gary Gregory <garydgreg...@gmail.com> a écrit :

> I agree with the second part assuming the *current* Java
> best practices, not because of old APIs that are here to stay
> only because of infinite backwards compatibility, and not
> because they are deemed perfect.


Best practices on this haven't changed since Java 1.0 (Possibly Java
1.0 alpha 3 if I recall versions correctly).

Checked exceptions: all errors arising from external input to the program.
Runtime exceptions: program bugs

I don't know which applies here, but 99% of the time this is all you
need to consider to figure out whether a checked or runtime exception
is called for. There are indeed a lot of old broken APIs that don't
follow these simple rules, and it's never fun when a system goes down
in production because some random JSON yahoo thought checked
exceptions were "icky".

Lately I've been working in Python, and error handling practice in
this community is abominable. The lack of checked exceptions is a
large reason why Python code is expected to be unreliable and Python
programs routinely dump stack.

-- 
Elliotte Rusty Harold
elh...@ibiblio.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to