Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If you just have a small application maybe dont use a language designed solely for enterprise use
-
xonya50816yChecked exceptions are one of the most hated features of Java. They can be really annoying, especially if you use lambda expressions.
You can do something like this:
} catch(IOException e) {
throw new RuntimeException(e);
}
http://literatejava.com/exceptions/... -
mampf1836y@sharktits it is for my company and we do not reply have anything other available besides python and perl without any 3rd party modules. So it's Java and Jackson.
-
Npstr6576yJava is a nice and powerful language.
Sadly, checked exceptions are somewhat abused in many official parts (IOException in many places, SQLException in JDBC, to name the most notorious ones).
Anyways rethrowing to unchecked one is the way to deal with it, if you don't have any alternative to act on it in the place where it is thrown.
Related Rants
I really cannot see why there still isn't an API in Java where I can get an hashing algorithm without having to catch a checked exception.
Granted, Bouncy castle is a top library. But of you just have a small application with a single method wanting to hash a few values... It's so nuts and unnecessary.
So what do you do in the catch block? Either throw a checked exception (because without that hash your app won't work), or calculate a replacement. But if it were that easy, I wouldn't have needed a hash on the first place.
I really wonder what the java developers had in mind.
Same with IO exception. I'm beginning to like python more and more.
And, of course, kotlin.
rant
api
java
hashing
checked exception
language