Interface and duck typing woes

Chris Angelico rosuav at gmail.com
Wed Aug 28 21:39:25 EDT 2013


On Thu, Aug 29, 2013 at 11:20 AM, Cameron Simpson <cs at zip.com.au> wrote:
> However, when working in Java its type strictness caught a great
> many simple brainfart logic errors by checking function signatures;
> typically calling the wrong function/method or mangling arguments.
> Getting this stuff up front was handy.

It certainly is useful, which is why I like a language with declared
types. But it's not everything, and it's certainly far from
sufficient. So once you've decided that run-time errors are normal,
you write code with that in mind (in a web server, for instance, you'd
have some code around the outside that catches and logs errors and
returns a 500 to the client), and then you don't stress about them.
Any you can catch early, do so, but don't put more effort into
catching errors early than you save by not having them later.

The novice thinks his primary job is to stop the program from
crashing. The expert knows that a crash is just another way for things
to go wrong, and one of the easiest to deal with.

ChrisA



More information about the Python-list mailing list