DEV Community

Discussion on: The Simple Guide to Programming Paradigms

Collapse
 
vrobweis profile image
Vincent Weis

People absolutely mention throwing exceptions as doing the same thing. The distinction is that exceptions being used for control flow is usually (almost always) an anti-pattern, for the same reason that using gotos for that purpose is.

But exceptions have an idiomatic use that is easier (if not trivial) to manually parse. They're virtually worthless without try/catch, but in conjunction with that, it's about as clean a way to handle "exceptional" cases as we have, short of algebraic effects. So it's likely that people feel that exceptions aren't as often misused as gotos are, because they have that idiomatic use case.