You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- 39Regarding throwing Exception, it isn't always because people are lazy, it's also common that you, when you implement frameworks, let users of the framework be able to throw any exception. You can e.g. check the signature of the Callable interface in JSEKaj– Kaj2011-05-24 19:53:41 +00:00Commented May 24, 2011 at 19:53
- 10@Kaj - yes, such general things like Callable, interceptors and the likes are special cases. But in most cases it's because people are lazy :)Bozho– Bozho2011-05-24 19:55:05 +00:00Commented May 24, 2011 at 19:55
- 8re: 3.1 "log it and return" Do so judiciously. This is very close to eating or hiding and exception. I'd do this for something that does not indicate a problem, that is not really exceptional. Logs get flooded and ignored too easily.Chris– Chris2012-07-25 14:07:50 +00:00Commented Jul 25, 2012 at 14:07
- 7"when you want to force the user of your API to think how to handle the exceptional situation" - you cannot force anyone to think if they do not want to. If they do not want to think, they will write a poor exception block that does nothing at all, or worse, deletes or interferes with critical error information. That is why checked exceptions are a failure.adrianos– adrianos2012-08-24 13:01:58 +00:00Commented Aug 24, 2012 at 13:01
- 3@adrianos "...you cannot force anyone to think if they do not want to...." With this line of thinking we could also remove compile errors.... I'm not really targetting you, I have heard this argument time and again and still find it to be the poorest possible explanation for labeling Checked Exceptions as a failure. As a side note, I have seen before such a language where compile (and runtime errors as well actually) were effectively made impossible by desing. That road led to some very dark places.Newtopian– Newtopian2016-08-11 17:49:05 +00:00Commented Aug 11, 2016 at 17:49
| Show 18 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. python-3.x), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-java