Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86592

Re: Python Worst Practices

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 <travisgriggs@gmail.com>
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 <travisgriggs@gmail.com>
In-Reply-To <mclca6$iie$1@ger.gmane.org>
Date Fri, 27 Feb 2015 13:21:27 -0800
Content-Transfer-Encoding quoted-printable
References <mclca6$iie$1@ger.gmane.org>
To Python <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.19318.1425072098.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


> On Feb 25, 2015, at 12:45 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> 
> http://www.slideshare.net/pydanny/python-worst-practices
> 
> Any that should be added to this list?  Any that be removed as not that bad?

I read ‘em. I thought they were pretty good, some more than others. And I learned some things. I especially liked the first one, since I’ve struggled with that one a bunch. In the context of “hey, accept Python for what it is”, I agree greatly with it. Memorize the builtins, and stay the heck away from them. I’ve been burned many times because I stored some bytes in a binding call, er, uh, ‘bytes’. And having mentored some people learning Python in the early stages, any explanation other than “Thou Shalt Never Use These Holy Words” just confuses people.

That said… 

If I were giving a talk at SPLASH (or some other suitable polyglot conference), I might do one called “Language Design Worst Practices”.

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’t 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’re making at authorship time, deferring the educational experience to sundry run times

In my examples column of this bad practice, I’d 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’t need to be one of the prominent “worst practices” slide.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Python Worst Practices Travis Griggs <travisgriggs@gmail.com> - 2015-02-27 13:21 -0800
  Re: Python Worst Practices Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-28 12:09 +1100
    Re: Python Worst Practices sohcahtoa82@gmail.com - 2015-02-27 17:32 -0800
      Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 12:44 +1100
        Re: Python Worst Practices Christian Gollwitzer <auriocus@gmx.de> - 2015-03-03 09:51 +0100
          Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-03-03 22:12 +1100
            Re: Python Worst Practices Christian Gollwitzer <auriocus@gmx.de> - 2015-03-03 23:46 +0100
              Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-03-04 10:12 +1100
                Re: Python Worst Practices Christian Gollwitzer <auriocus@gmx.de> - 2015-03-04 21:27 +0100
    Re: Python Worst Practices Dan Sommers <dan@tombstonezero.net> - 2015-02-28 04:42 +0000
      Re: Python Worst Practices Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-28 17:36 +1100
        Re: Python Worst Practices Dan Sommers <dan@tombstonezero.net> - 2015-02-28 07:50 +0000
          Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 19:55 +1100
        Re: Python Worst Practices Ethan Furman <ethan@stoneleaf.us> - 2015-02-27 23:51 -0800
          Re: Python Worst Practices Marko Rauhamaa <marko@pacujo.net> - 2015-02-28 10:50 +0200
      Re: Python Worst Practices Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-28 01:48 -0700
      Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 19:58 +1100
    Re: Python Worst Practices Tim Chase <python.list@tim.thechases.com> - 2015-02-27 21:50 -0600
      Re: Python Worst Practices Cousin Stanley <cousinstanley@gmail.com> - 2015-02-28 09:03 -0700
        Re: Python Worst Practices Rustom Mody <rustompmody@gmail.com> - 2015-02-28 08:16 -0800
        Re: Python Worst Practices MRAB <python@mrabarnett.plus.com> - 2015-02-28 17:56 +0000
        Re: Python Worst Practices Ethan Furman <ethan@stoneleaf.us> - 2015-02-28 10:13 -0800
        Re: Python Worst Practices Tim Chase <python.list@tim.thechases.com> - 2015-02-28 12:30 -0600
        Re: Python Worst Practices Tim Chase <python.list@tim.thechases.com> - 2015-02-28 12:39 -0600
    Re: Python Worst Practices BartC <bc@freeuk.com> - 2015-02-28 10:39 +0000
      Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 23:45 +1100
        Re: Python Worst Practices Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-03-01 13:29 +1300

csiph-web