Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

As others have mentioned numerously, (e.g. in this Stack Overflow questione.g. in this Stack Overflow question), the principle of least astonishment will forbid that you use exceptions excessively for control flow only purposes. On the other hand, no rule is 100% correct, and there are always those cases where an exception is "just the right tool" - much like goto itself, by the way, which ships in the form of break and continue in languages like Java, which are often the perfect way to jump out of heavily nested loops, which aren't always avoidable.

As others have mentioned numerously, (e.g. in this Stack Overflow question), the principle of least astonishment will forbid that you use exceptions excessively for control flow only purposes. On the other hand, no rule is 100% correct, and there are always those cases where an exception is "just the right tool" - much like goto itself, by the way, which ships in the form of break and continue in languages like Java, which are often the perfect way to jump out of heavily nested loops, which aren't always avoidable.

As others have mentioned numerously, (e.g. in this Stack Overflow question), the principle of least astonishment will forbid that you use exceptions excessively for control flow only purposes. On the other hand, no rule is 100% correct, and there are always those cases where an exception is "just the right tool" - much like goto itself, by the way, which ships in the form of break and continue in languages like Java, which are often the perfect way to jump out of heavily nested loops, which aren't always avoidable.

replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

In essence, our usage of these non-local gotos is just along the lines of what Mason WheelerMason Wheeler said in his answer:

In essence, our usage of these non-local gotos is just along the lines of what Mason Wheeler said in his answer:

In essence, our usage of these non-local gotos is just along the lines of what Mason Wheeler said in his answer:

added 36 characters in body
Source Link
Lukas Eder
  • 1.1k
  • 3
  • 20
  • 32

It explains how inside of jOOQ (a SQL abstraction library for Java) (disclaimer: I work for the vendor), such exceptions are occasionally used to abort the SQL rendering process early when some "rare" condition is met.

It explains how inside of jOOQ (a SQL abstraction library for Java), such exceptions are occasionally used to abort the SQL rendering process early when some "rare" condition is met.

It explains how inside of jOOQ (a SQL abstraction library for Java) (disclaimer: I work for the vendor), such exceptions are occasionally used to abort the SQL rendering process early when some "rare" condition is met.

Source Link
Lukas Eder
  • 1.1k
  • 3
  • 20
  • 32
Loading