Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'run-time': 0.05; 'logic': 0.09; 'wrong,': 0.09; 'useful,': 0.14; 'declared': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'normal,': 0.16; 'simpson': 0.16; 'language': 0.16; 'wrote:': 0.18; 'server,': 0.19; 'thu,': 0.19; '(in': 0.22; 'aug': 0.22; 'certainly': 0.24; 'instance,': 0.24; 'java': 0.24; 'primary': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; 'catching': 0.31; 'crash': 0.31; 'types.': 0.31; 'front': 0.32; 'stuff': 0.32; 'another': 0.32; 'checking': 0.33; 'knows': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'effort': 0.37; 'wrong': 0.37; 'so,': 0.37; 'easiest': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'catch': 0.60; 'logs': 0.60; 'simple': 0.61; 'save': 0.62; "you've": 0.63; 'decided': 0.64; 'more': 0.64; 'great': 0.65; '500': 0.70; 'everything,': 0.84; 'novice': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=8j9r6ZqGvMhcrk52bDiS1kDDpls5+5J51zljw/2f4sU=; b=uCKNoOs0J0iSBSBgb4CoML3d/3zA8TLhIPvxrbQ2ECJpjtvQjlc9HUSpSUgyOKn9bD bzF+kLCNYs6fLYBjloz/OLVtQCHiuPgxDwbNjjQZUj5/l3z2nx4AFdL98UZP8wvBqpyl vjfhZWxwg54mpkNTxJiZxsoKoYEv/v6IIyhe6nB9uYw++9/RPlY6xsVUeGvpf497aJB8 ybOWnV450aiKhCxoyjMZ0PYek78AW8uaDI9e64F3eXx5bDWhVOfl7By8SHpoNTkH+X+a ndkPFnHACUwiNzM2sBZyihTHmdKg9iDg9Plz/2V5u8ny+5tS/f9ULIPYqF0qlPNCciSQ gedA== MIME-Version: 1.0 X-Received: by 10.58.249.136 with SMTP id yu8mr561077vec.37.1377740365670; Wed, 28 Aug 2013 18:39:25 -0700 (PDT) In-Reply-To: <20130829012020.GA47225@cskk.homeip.net> References: <20130829012020.GA47225@cskk.homeip.net> Date: Thu, 29 Aug 2013 11:39:25 +1000 Subject: Re: Interface and duck typing woes From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377740373 news.xs4all.nl 15906 [2001:888:2000:d::a6]:35183 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53210 On Thu, Aug 29, 2013 at 11:20 AM, Cameron Simpson 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