Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'languages,': 0.04; 'syntax': 0.04; 'warnings': 0.04; 'subject:Python': 0.06; 'abuse': 0.07; 'column': 0.07; 'context': 0.07; 'list?': 0.07; 'practice,': 0.07; 'bytes,': 0.09; 'explanation': 0.09; 'i\xe2\x80\x99ve': 0.09; 'lawrence': 0.09; 'python': 0.11; 'stored': 0.12; 'bind': 0.16; 'holy': 0.16; 'i\xe2\x80\x99d': 0.16; 'shalt': 0.16; 'stages,': 0.16; 'uh,': 0.16; 'worst': 0.16; 'language': 0.16; 'wrote:': 0.18; 'things.': 0.19; 'examples': 0.20; 'feb': 0.22; 'bytes': 0.24; '(or': 0.24; 'header:In-Reply-To:1': 0.27; 'received:172.16': 0.29; 'words': 0.29; 'especially': 0.30; '25,': 0.31; 'constant': 0.31; 'run': 0.32; 'programmers': 0.33; 'agree': 0.35; 'common': 0.35; 'convert': 0.35; 'late': 0.35; 'one,': 0.35; 'received:google.com': 0.35; 'object,': 0.36; 'should': 0.36; 'message-id:@gmail.com': 0.38; 'others.': 0.38; 'requiring': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'bad': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'called': 0.40; 'read': 0.60; 'course.': 0.60; 'liked': 0.60; 'most': 0.60; 'first': 0.61; 'times': 0.62; 'making': 0.63; 'header:Message- Id:1': 0.63; 'more': 0.64; 'forward': 0.65; 'between': 0.67; 'obvious': 0.74; 'can\xe2\x80\x99t': 0.84; 'confusing': 0.84; 'subject:Practices': 0.84; 'visits': 0.84; 'good,': 0.91; 'mistake': 0.91; 'you\xe2\x80\x99re': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=RoCRjMUp8OAcSbW+SJVPz8nIepEY9wksP+7/S16OOoo=; b=DvNrj9X9G/N31jT3cmxlSqUMZI4iSfqJLpb2yc0+ySIR+eK+6YIE9NcNNhPqQh/WIo 0Rcr+CX9G79vEvvm3veNEUZITuyzj1Ia2kKHNV5MU2FpRLatPQ2NVk9REI47e7DDnRmi LCsCihvsARHdnrrbpZweOo+yqjYUDaYa2nPtAqangKDugeXEiP15Y7KlYpZIm0/jkIWk AA4XZzap2G3Zsvm9S3waIXIN85VWFMxPSzsQNzyVT50EjV1tpXK2XKWNESxArtVEVC9q QDo2hUeHgSdgR7gTRfAF1pmXJdumP3cdeVyJ1zy7rSam+L1wL7gWbZ214XpPzPKN547l X+qA== X-Received: by 10.68.130.101 with SMTP id od5mr27707770pbb.108.1425072089253; Fri, 27 Feb 2015 13:21:29 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Python Worst Practices From: Travis Griggs In-Reply-To: Date: Fri, 27 Feb 2015 13:21:27 -0800 Content-Transfer-Encoding: quoted-printable References: To: Python X-Mailer: Apple Mail (2.2070.6) 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1425072098 news.xs4all.nl 2847 [2001:888:2000:d::a6]:56566 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86592 > On Feb 25, 2015, at 12:45 PM, Mark Lawrence = wrote: >=20 > http://www.slideshare.net/pydanny/python-worst-practices >=20 > Any that should be added to this list? Any that be removed as not = that bad? I read =E2=80=98em. I thought they were pretty good, some more than = others. And I learned some things. I especially liked the first one, = since I=E2=80=99ve struggled with that one a bunch. In the context of = =E2=80=9Chey, accept Python for what it is=E2=80=9D, I agree greatly = with it. Memorize the builtins, and stay the heck away from them. I=E2=80=99= ve been burned many times because I stored some bytes in a binding call, = er, uh, =E2=80=98bytes=E2=80=99. And having mentored some people = learning Python in the early stages, any explanation other than =E2=80=9CT= hou Shalt Never Use These Holy Words=E2=80=9D just confuses people. That said=E2=80=A6=20 If I were giving a talk at SPLASH (or some other suitable polyglot = conference), I might do one called =E2=80=9CLanguage Design Worst = Practices=E2=80=9D. One of my first slides might be titled: Abuse Common Tokens in Confusing Ways * Make your language have a lot of keywords. Enough to make memorizing = them ALL unlikely, requiring constant visits to your documentation * Make sure said keywords are many of the obvious words programmers = would use in their applications (map, object, bytes, dir, etc) * Design your syntax so that you can=E2=80=99t disambiguate them = contextually between bind and reference * Be sure to use it in a late bound language where no warnings will be = provided about the mistake you=E2=80=99re making at authorship time, = deferring the educational experience to sundry run times In my examples column of this bad practice, I=E2=80=99d put Python of = course. :) I do like Python, and I accept it for what it is, so no one needs to = jump forward as a Holy Python See to convert me to the truth. I also = know that with most other languages, that first slide wouldn=E2=80=99t = need to be one of the prominent =E2=80=9Cworst practices=E2=80=9D slide.=