101 reputation
1
bio website ampsoft.net
location Spain
age
visits member for 2 years, 9 months
seen May 15 '12 at 16:49

Mar
11
comment Defensive Programming vs Exception Handling?
+1. I like the idea of exception handling, but I try to use error checking as the first option, not only for avoiding "exception laziness" (using try..catch as a replacement for a better program logic), but also because it avoids some dangerous bugs: e.g. at my workplace the function (not python) that queries the DB returns false (no exception) when the SQL query fails, and if you try to you use an uninitialized result set it throws an exception, but maybe you have it "initialized" of previous use (e.g. when it fails in the middle of a loop), so instead of failing you are using the wrong data.
Mar
11
awarded  Supporter