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


Groups > comp.lang.python > #86592

Re: Python Worst Practices

Subject Re: Python Worst Practices
From Travis Griggs <travisgriggs@gmail.com>
Date 2015-02-27 13:21 -0800
References <mclca6$iie$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.19318.1425072098.18130.python-list@python.org> (permalink)

Show all headers | 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