Closed JoshuaKGoldberg closed 3 weeks ago
I think #137 -> #138 ended up pretty much answering what this article was looking for. I'll use https://www.learningtypescript.com/articles/why-typescript-doesnt-include-a-throws-keyword#barriers-to-throw-types in its place. 👍
Overview
Speaking generally: https://softwareengineering.stackexchange.com/questions/189222/are-exceptions-as-control-flow-considered-a-serious-antipattern-if-so-why is a good summary of my perspective here.
I think the most salient point is the Principle of Least Astonishment. Since exceptions can't reasonably be indicated in type signatures, using exceptions requires developers memorizing which functions may throw them as a part of their "normal" flow. That's a recipe for astonishment - especially if the implicit intentional-exception-throwing contract changes unexpectedly.