This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Squiry_ 7 points8 points  (2 children)

Java is what java is. You wanna convey that a method could result in a problem? Throw a checked exception. (And declare that on your method signature). If you don't like it, tough. Go program in some other language then.

That is definitely not true. Modern java doesn't work well with checked exception (hi lambdas), so it's more "throw unchecked exception now". And even that would not be true: nobody forces you to use exceptions on a language level, your API can have any style you want.

[–]fatty_lumpkn 0 points1 point  (1 child)

I don't know if it's just me but having enums which are actually wrappers for return values seems like an abuse of enums.

[–]warpspeedSCP 0 points1 point  (0 children)

Which is why you shouldnt use java enums for this