3 ms·
There are plenty of code bases that are dramatically simpler when exceptions are in use, especially if you just want to read and understand the happy path. I'm
by quietbritishjim 4y ago
There are plenty of code bases that are dramatically simpler when exceptions are in use, especially if you just want to read and understand the happy path. I'm tempted to give an example or two but I'm sure most readers know that really.
There is definitely a trade off for efficiency and guarantees about all error conditions being handled. That means that exceptions aren't appropriate for all situations or perhaps even for all languages. But taking such a hard line against them is just as naive as using them too much. (It's always suspicious when you see someone making a sweeping declaration like this about engineering trade offs.)
Python is not Rust. Its goal is not to be hardened and super reliable. Its goal, at least sometimes, is to maximise developer productivity. Imagine telling a Python developer who's just thrown together a quick script that, actually, no, you're going to have to waste time making it more verbose so that it satisfies some reliability constraint you don't need. It just doesn't make sense.