It isn’t only Java, though I believe Java was the first to use throw idiomatically. The big problem is that code becomes impossible to meaningfully analyze; one large Java project was found to have 1300 “indefinite” catch targets.

The other problem is that what was intended to catch genuine exceptions immediately morphed into a way to save typing, with less than 1% of calls to throw handling exceptions of any kind, mostly used where return codes should have been. It really is a mess. If I were the Emperor of IT I would have it backed out of every language that uses it and only the operating system and runtime would be allowed to throw. WE should only write try and catch.

American Software Developer living in Vietnam. Classical musician (guitar, woodwinds), weightlifter, multilingual, misanthrope • XY

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store