Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 12902

An exception is an occurrence in an application process that requires deviation from the program's normal flow.

5 votes

Is throwing an exception from a property bad form?

I would definitely argue that there is a flaw in the design if you feel the need to throw exceptions from a property setter or getter. … This does produce side effects, and may throw exceptions. But this property setter is basically just a wrapper around Stream.Seek that you could call instead. …
Pete's user avatar
  • 8,986
20 votes

Are exceptions as control flow considered a serious antipattern? If so, Why?

Using exceptions for control flow is generally considered an anti-pattern, but there are exceptions (no pun intended). … So, although exceptions are generally not used for control flow, your language of choice may have other idioms. …
Pete's user avatar
  • 8,986
1 vote

Is it okay to use exceptions as tools to "catch" errors early?

In general, yes, it is a good idea to "fail early". However, in your specific example, the explicit IllegalArgumentException does not provide a significant improvement over a NullReferenceException - …
Pete's user avatar
  • 8,986
5 votes
1 answer
231 views

Why are F# exceptions generally not suffixed with 'Exception'?

Documentation* exception MyError of string The book 'Expert F# 3.0', co-authored by Don Syme, has an example that doesn't even seem to follow any idiom: exception BlockedURL of string Why don't custom exceptions
Pete's user avatar
  • 8,986
10 votes

Checked vs Unchecked vs No Exception... A best practice of contrary beliefs

For a long time OO languages, the use of exceptions have been the de-facto standard for communicating errors. …
Pete's user avatar
  • 8,986