Skip to main content

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.

3
  • That's the way I'd do it in Java for sure; I'm less certain about C# idioms, but it is at least clearer and easier to write given that C# has proper exceptions in the first place. Commented Jun 8, 2014 at 19:23
  • Exceptions are expensive. Even with fast object creation, it'll be slower to throw an exception than evaluate a Boolean Commented Jun 8, 2014 at 21:13
  • 1
    More than the expense, this sounds like using exceptions for flow control, which is generally frowned upon (with good reason!). Commented Jun 10, 2014 at 16:14