On Wed, Aug 10, 2016 at 1:22 AM Juan Pablo Romero Méndez < jpablo.rom...@gmail.com> wrote:
> 1) catching exceptions at the point where you care, 2) > preemptively check for certain runtime conditions to avoid exceptions 3) > write as many tests as possible 4) learn to live with runtime errors. > I suggest focusing on #4, learn to appreciate/enjoy runtime errors. When you've come around to that way of thinking, you'll have better judgement on when to care about catching exceptions vs letting them stop your program. As for writing as many tests as possible... eh. Think about your code scientifically. You can disprove a falsifiable hypothesis, but you can't prove a hypothesis. Sometimes you can formally prove the correctness of your code via logical deduction, but that's not testing. Sometimes you can exhaustively test all expected inputs, but it's impossible to exhaustively test the infinity of possible inputs. So write tests as if you're presenting evidence for a theory. -- https://mail.python.org/mailman/listinfo/python-list