4 ms·
The language isn't forcing you. The developer who chose to use a checked exception is forcing you. Is the language "forcing" you when someone writes a function
by ragnese 6y ago
The language isn't forcing you. The developer who chose to use a checked exception is forcing you.
Is the language "forcing" you when someone writes a function that returns a String? What if I wanted it to be an Int?
- narag 6y agoEdit: OK, someone is downvoting ALL comments because opinions. No more comments by me. I'll delete everything that I can. Seriously, if someone doesn't want to read opposing opinions, I guess it's their right. And mine is to STFU, for good. Edit2: hey TeMPOraL, I don't care too much about that, it's the feeling of being in a community where someone thinks this is an acceptable behaviour. I've been writing here for very long. But this is getting ridiculous. Anything that is minimally controversial gets downvoted. And the thing is that I am already censoring myself a lot.
- TeMPOraL 6y ago> It doesn't make much of a difference if Sun, the authors of the language, or Sun, the authors of the runtime, is screwing me. But it matters for me, the programmer using modules written by other co-workers and third party libraries, that I'm made aware of what can fail and at what point, when I'm using these modules/libraries. It also matters to me that my tools (e.g. the compiler) force me to handle these cases correctly, or at least warn me when I'm not - lest I ship broken code through carelessness or ignorance. Quality Sun's API design is a different issue. This is about giving people tools to express and enforce error handling semantics in software they design. EDIT: > Edit: OK, someone is downvoting because opinions. No more comments by me. It's good to not be attached to imaginary Internet points. They come and go and ultimately don't matter much. And FWIW, bad downvotes often get countered, and the score of a given comment settles to something reasonable over time.
- erik_seaberg 6y agoJava generics aren't powerful enough; an exception signature is a union type whose size varies. There's no way to declare that a method's exception signature depends on the signatures of the arguments for each call. No way to take a lambda or method reference and throw whatever that could throw. Checking is nice but IMHO not worth giving up higher-order functions.
- ragnese 6y agoSounds like an issue with generics and lambdas in Java