Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'output': 0.04; 'subject:Python': 0.05; 'compiler': 0.05; 'run-time': 0.05; 'compile-time': 0.07; 'python': 0.09; 'runtime': 0.09; 'static': 0.13; '12:04': 0.16; 'compile.': 0.16; 'executed.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inputs': 0.16; 'rem': 0.16; 'semicolon': 0.16; 'statement.': 0.16; 'syntactic': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'have:': 0.17; 'feb': 0.19; 'code.': 0.20; 'error.': 0.21; 'errors': 0.23; 'header:In-Reply-To:1': 0.25; 'errors.': 0.27; 'message- id:@mail.gmail.com': 0.27; 'all.': 0.28; "d'aprano": 0.29; 'steven': 0.29; 'convert': 0.29; 'source': 0.29; 'error': 0.30; 'code': 0.31; 'running': 0.32; 'could': 0.32; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'really': 0.36; 'but': 0.36; 'test': 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'application': 0.40; 'your': 0.60; 'side': 0.61; 'between': 0.63; '10.': 0.64; 'become': 0.65; 'of:': 0.65; '2013': 0.84; 'difference.': 0.84; 'effects,': 0.84; "everything's": 0.84; 'hugely': 0.84; 'omission': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=id+R+TEN1SMs91X/kBJPMeFSO/SYf7OcG0CYKAc/T8s=; b=c+9f8MGexHaPxZx6mB4nmpy2vXAzFrde05FEDmZobqFYeNQZ3Fl8vehUiWtKNkNoEx oxtICg+XP4lievden4QPNASykB/7wTeHiH8BUEKVMFtCqkV0bUYcyAMDtqIyB0oNbwwu jmQN8LSxg6WVxNnnSWr1pomvtWwIfbfNa/C0Njr+G7cSeLA92bdbw4nk7pruEY4mUKoW rSD8a6tIrr1BBWIBgjCdTqL0fsEgvqkcd8UY6xCx1DGWGS+OehnTiiD2NfnG50Db5gNr o1/PrK2QTgAf9jdanD8LPR6Y0ahpdOSQ4ioA6kDJwhT9DNgiy41HLFGLIKK/Xhjgv5TV xplg== MIME-Version: 1.0 X-Received: by 10.52.67.164 with SMTP id o4mr7898232vdt.42.1361755671397; Sun, 24 Feb 2013 17:27:51 -0800 (PST) In-Reply-To: <512ab8aa$0$29998$c3e8da3$5496439d@news.astraweb.com> References: <9p1ii899tkalvfd1cl7sneoqa9t1cqh4oj@invalid.netcom.com> <5129482F.3080402@gmail.com> <512a5199$0$29998$c3e8da3$5496439d@news.astraweb.com> <5a3bf25b-a08b-4084-a940-e1fd05a1045d@googlegroups.com> <2e9471ad-8320-4f7f-80ba-cd5a7f8f013d@googlegroups.com> <512ab8aa$0$29998$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 25 Feb 2013 12:27:51 +1100 Subject: Re: Python Newbie 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361755679 news.xs4all.nl 6965 [2001:888:2000:d::a6]:38816 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39850 On Mon, Feb 25, 2013 at 12:04 PM, Steven D'Aprano wrote: > Not at all. The only difference is whether you get a compiler error or a > runtime error. Instead of: > > 10 Write code. > 20 Compile. > 30 If compiler error, GO TO 10. > 40 REM code compiles, but it still needs to be tested > 50 Test code. > 60 If error, GO TO 10. > 70 Deploy. > > we have: > > 10 Write code. > 20 Test code. > 30 If error, GO TO 10. > 40 Deploy. The advantage of compile-time errors is that you don't have to wait for *that branch* to be executed. So they're hugely advantageous when it comes to the "obvious problems" like syntactic errors... and looky here, Python does exactly that :) The only difference between "static" and "dynamic" is how much is done at each phase. If your program has no inputs or side effects, the compiler could theoretically convert it into a single static output statement. Voila! All your run-time errors have become compile-time errors. Conversely, you could compile your application from source just before running it. Voila! Everything's a run-time error, even the omission of a semicolon in C. Okay, both of those are pretty stupid examples, but there's really no fundamental difference. ChrisA