Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.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.031 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'programmer': 0.03; 'debugging': 0.07; 'subject:code': 0.07; 'coding,': 0.09; 'someone,': 0.09; 'subject:posting': 0.09; 'sure,': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.11; 'itself.': 0.14; '9:15': 0.16; 'brilliant': 0.16; 'expert,': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'manageable': 0.16; 'objection': 0.16; 'smart,': 0.16; 'variants': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'code,': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'him.': 0.24; 'helpful': 0.24; '(or': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'posting': 0.31; 'complete,': 0.31; 'explained': 0.31; 'respects': 0.31; 'though.': 0.31; 'yourself.': 0.31; 'run': 0.32; 'another': 0.32; 'everyone': 0.33; 'fri,': 0.33; 'problem': 0.35; 'knows': 0.35; 'but': 0.35; 'received:google.com': 0.35; "he's": 0.36; 'should': 0.36; 'problems': 0.38; 'ben': 0.38; 'form,': 0.38; 'process,': 0.38; 'little': 0.38; 'expect': 0.39; 'explain': 0.39; 'does': 0.39; 'extremely': 0.39; 'itself': 0.39; 'sure': 0.39; 'even': 0.60; 'solve': 0.60; 'helps': 0.61; "you're": 0.61; "you'll": 0.62; 'complete': 0.62; "you've": 0.63; 'making': 0.63; '(that': 0.65; 'talking': 0.65; 'american': 0.66; 'believe': 0.68; 'partner': 0.70; 'intelligent': 0.74; 'subject.': 0.74; 'female': 0.84; 'her.': 0.84; 'idiot': 0.84; 'madness': 0.84; 'male': 0.84; 'short,': 0.84; 'touching': 0.84; 'bears': 0.91; 'to:none': 0.92; 'technique': 0.93 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:cc :content-type:content-transfer-encoding; bh=Vm27gK9IVY1m0I2O3aeYs1mqAKrs2DVdzGrgPsP70lI=; b=LM9I97cZXjNBNBtBpC+mCGDgd+vrHATPVGof7yrmej+TikDg1RepiNfdhuxP4jMfIL apW6z6ae+IvXQZi/l0/9SwelU2h+8QiIxt5NaYL5HhhVD8CC27g3i4jwrN2UUXucC4DA xQFwRLC1e2FqdvBJhm5bJQUJ8SNM2xqnzz7wQNJHeatIQWSxuZRHxqbgGg/124XJitOI r01Y23u9ujJZrN1tuHOV4oW5pKostWjQhmldrECFCw2/Vs7Mgr+YB64vyewDkqcJk0GX Cc2Go6YcArE3UwM2vtRHLHNy8yPbFhkyyUdscF4uXuL4QyqRi5CK98H6RCtLp5vioaIz 4EaQ== MIME-Version: 1.0 X-Received: by 10.66.129.133 with SMTP id nw5mr1345041pab.98.1393566088981; Thu, 27 Feb 2014 21:41:28 -0800 (PST) In-Reply-To: <85ppm8nqx7.fsf@benfinney.id.au> References: <85ppm8nqx7.fsf@benfinney.id.au> Date: Fri, 28 Feb 2014 16:41:28 +1100 Subject: Re: posting code snippets From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393566098 news.xs4all.nl 2845 [2001:888:2000:d::a6]:48715 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67201 On Fri, Feb 28, 2014 at 9:15 AM, Ben Finney wr= ote: > Since you'll be posting the code in-line, make sure it's short. Since > it'll be short, make sure it's complete =E2=80=94 we should need nothing = else to > run the code and expect to see the same behaviour you're seeing. > > Since you'll be making it short, complete, and still demonstrating the > behaviour, you may even get the result that you understand the cause of > the behaviour before posting it. Everyone wins! :-) Which is the scientific basis of the astonishingly successful (that is, it's astonishing to people who don't understand) debugging technique of Rubber Ducking, or talking to your teddy bear, or other variants of the subject. (I have a figurine from American McGee's "Alice: Madness Returns" who is extremely helpful to me. She's pretty, she's smart, and she's pretty smart.) By the time you've explained it to someone, you've boiled the problem down into a manageable form, and that often helps you solve the problem yourself. The problem does have to believe that the rubber duck/teddy bear/figurine is an expert, though. I've had my siblings or parents come to me with problems and, without saying a word or touching the computer or anything, I've solved them. The problem itself respects my skill, and retracts its objection and solves itself. Why this works I am not sure, but just remember to treat your teddy bear as an intelligent partner in the debugging process, not as an idiot who just gets in the way. He's a brilliant programmer from another dimension; he knows all about coding, but not about your code, so you have to explain its little oddities to him. (Or her. Female teddy bears are just as good at debugging as male ones are.) ChrisA