DEV Community

Discussion on: Python exceptions considered an anti-pattern

Collapse
 
misterobow profile image
Mr. Vegetable • Edited

In my experience, exceptions in Python mostly make things MORE clear, not less, since they are used as ordinary control flow, like for or if, and you just expect them. Our brain models a lot of things in terms of "typical case + few special cases" and so, for me personally, exceptions make it much more easier to convert ideas into code and understand the ideas behind the code.

Exceptions are not errors or problems or unexpected thing. They are just cases that don't arise most often. So for me it's logically wrong to map them to "Failure". And the problem of finding "where the exception is caught" does not seem to become significantly easier when converted to "where do we check that the return result is Failure".