Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'algorithm': 0.04; 'deny': 0.07; 'subject:design': 0.09; 'width': 0.09; 'python': 0.11; 'language.': 0.14; 'braces': 0.16; 'braces,': 0.16; 'code?': 0.16; 'declaration': 0.16; 'formatting.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'materially': 0.16; 'quoted': 0.16; 'retained': 0.16; 'routinely': 0.16; 'subject:Language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'meant': 0.20; '>>>': 0.22; "aren't": 0.24; 'text,': 0.24; 'source': 0.25; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'specifically': 0.29; 'fixed': 0.29; 'chris': 0.29; "we'd": 0.29; 'thus': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'that.': 0.31; 'usually': 0.31; '13,': 0.31; '>>>>': 0.31; 'argue': 0.31; "d'aprano": 0.31; 'follows': 0.31; 'indentation': 0.31; 'sep': 0.31; 'steven': 0.31; 'text': 0.33; 'running': 0.33; 'fri,': 0.33; "i'd": 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; '+0200,': 0.36; 'like,': 0.36; 'changing': 0.37; 'wrong': 0.37; 'being': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'bad': 0.39; 'extremely': 0.39; 'structure': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'above,': 0.60; 'removing': 0.60; 'lost': 0.61; 'information,': 0.61; 'making': 0.63; 'real': 0.63; 'here': 0.66; 'content,': 0.68; 'frequently': 0.68; 'statement,': 0.68; 'unusual': 0.74; 'restore': 0.78; 'mistakes,': 0.84; 'pardon': 0.84; 'thing,': 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=WrQj/VElVUYliBfFF+Nn8LvfDDgca6Iw+UsLA4zyJ9E=; b=dDXkr5pAVi6uDq4yVhCT1fAoqJLcDku8aPtFab45MCuOfZLNDw5iFmKGwHKskYhvXX Z1NDEOtMLHT90DUZwSc+U5Kk/2KnZgvcjSftoZ8CDEaK2OVB3FA/H6rGYqf99xsNVReh EMir8aM5feO4H0bIFlcWu90pb8a7Shh9DL7HrBz6ZhUQn4QoyYj+J3CJM48puA24KZ7z 9mah1Vg1YJ3vHfcUWYLCy22U1Ci5X0q2v3uZF/W0iQEiUEC7WB1Xk2tbwOORy64S+MHb J3lnbbzRbsIDtf2Hkbe/DMo9KqU5jwSOwPzVmKRjqd3jCVrOjBnK4pg8GRv0uyCeRFx8 kvlA== MIME-Version: 1.0 X-Received: by 10.58.196.132 with SMTP id im4mr609673vec.28.1379071009295; Fri, 13 Sep 2013 04:16:49 -0700 (PDT) In-Reply-To: <5232e562$0$29988$c3e8da3$5496439d@news.astraweb.com> References: <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> <5232e562$0$29988$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 13 Sep 2013 21:16:49 +1000 Subject: Re: Language design 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379071017 news.xs4all.nl 15986 [2001:888:2000:d::a6]:42617 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54110 On Fri, Sep 13, 2013 at 8:13 PM, Steven D'Aprano wrote: > On Fri, 13 Sep 2013 09:04:06 +0200, Antoon Pardon wrote: > >> Op 10-09-13 12:20, Chris Angelico schreef: >>> On Tue, Sep 10, 2013 at 4:09 PM, Steven D'Aprano >>> wrote: >>>> What design mistakes, traps or gotchas do you think Python has? >>>> Gotchas are not necessarily a bad thing, there may be good reasons for >>>> it, but they're surprising. >>> >>> Significant indentation. It gets someone every day, it seems. >>> >>> >> Not only that. There are a lot of python code snippets on the net that >> for whatever reason lost their indentation. There is no algorithm that >> can restore the lost structure. > > Is there an algorithm that will restore the lost structure if you delete > all the braces from C source code? > > Perhaps if web sites and mail clients routinely deleted braces, we'd see > the broken-by-design software being fixed instead of blaming the language. While I don't deny your statement, I'd like to point out that English usually isn't overly concerned with formatting. You can take this paragraph of text, unwrap it, and then reflow it to any width you like, without materially changing my points. C follows a rule of English which Python breaks, ergo software designed to cope only with English can better cope with C code than with Python code. Removing all braces would be like removing all punctuation - very like, in fact - a very real change to the content, and destruction of important information. Python is extremely unusual in making indentation important information, thus running afoul of systems that aren't meant for any code. But if you look at the quoted text above, I specifically retained your declaration that "Gotchas are not necessarily a bad thing" when citing significant indentation. I'm not here to argue that Python made the wrong choice; I'm only arguing that it frequently confuses people. ChrisA