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


Groups > comp.lang.python > #72609

Re: Benefits of asyncio

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; '(at': 0.04; '(even': 0.05; 'argument': 0.05; '"if': 0.09; 'php,': 0.09; 'properly.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'mostly': 0.14; 'thread': 0.14; 'against)': 0.16; 'burak': 0.16; 'clear.': 0.16; 'code?': 0.16; 'competent': 0.16; 'expert,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'indent': 0.16; 'nightmare': 0.16; 'programmer,': 0.16; 's/he': 0.16; 'there?': 0.16; 'unexpectedly': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'wed,': 0.18; 'possible,': 0.19; 'skip:f 30': 0.19; 'split': 0.19; 'stack': 0.19; 'code,': 0.22; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'junior': 0.24; 'earlier': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'least': 0.26; 'header:In-Reply- To:1': 0.27; 'generally': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'comments': 0.31; 'forces': 0.31; 'ok.': 0.31; 'produces': 0.31; 'styles': 0.31; 'with,': 0.31; 'probably': 0.32; 'run': 0.32; 'another': 0.32; 'entirely': 0.33; 'framework': 0.33; 'problem': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'really': 0.36; 'possible': 0.36; 'turn': 0.37; 'problems': 0.38; 'depends': 0.38; 'pm,': 0.38; 'anything': 0.39; 'does': 0.39; 'bad': 0.39; 'flow': 0.39; 'though,': 0.39; 'either': 0.39; 'how': 0.40; 'problems.': 0.60; 'helps': 0.61; 'skip:n 10': 0.64; 'more': 0.64; 'different': 0.65; 'judge': 0.68; 'quality': 0.72; 'forced': 0.84; 'goto': 0.84; 'seeing,': 0.84; 'favour': 0.91; 'to:none': 0.92
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:cc :content-type; bh=A4ED7ty4KjlBppNNl++By3zmhUbDOZeEpcF802BdFOw=; b=oevxl5j7MU1R+7StlrEOzNU7KpoEqaLbXiO2VIhiPndip6A1XLop/vxQsy+bAcRNX1 xQu+B043fzUAUGCfrDFQMU1Drn5BGA867QJjIX0MZwWaOMXY+kYpZCePGm/22BXfQArt 7YT5OgA2YFlpBSfm9rhBIWlcqsTZOkJEsHFs/HmenOtoHR0xdZgZWGsu4yV8SL1b7qgE FsPaxcs5zBT8ANacAuANMyH7lWi761AJrVsvEmFLJk6El/wFV4pUDyaQ9UvSC/SK6GGq KBRFmKSVh5WRue8XscViTf2JwFuARqBXeNx2xC1J6HWtFmPqCcRr0QJ0IWsDcuQPYO2G MDhA==
MIME-Version 1.0
X-Received by 10.220.133.197 with SMTP id g5mr41442445vct.20.1401867038870; Wed, 04 Jun 2014 00:30:38 -0700 (PDT)
In-Reply-To <538EAA54.2000308@arskom.com.tr>
References <d1634744-39e8-4bfa-be76-1fd2292fd59f@googlegroups.com> <mailman.10573.1401739639.18130.python-list@python.org> <874n03t5t9.fsf@elektro.pacujo.net> <7x4n03dor0.fsf@ruckus.brouhaha.com> <878upe8poc.fsf@elektro.pacujo.net> <mailman.10606.1401785234.18130.python-list@python.org> <87wqcyuznv.fsf@elektro.pacujo.net> <CAPTjJmpARfzmT76m-LRbrj0jcr7fq+dRD5ooprr25BufmM=pAQ@mail.gmail.com> <538DABE0.1070902@arskom.com.tr> <CAPTjJmpd_Tq2UpYE4tzbJSr-ZLp2KdNCJoTi1y_YQtmrz9sMpA@mail.gmail.com> <538EAA54.2000308@arskom.com.tr>
Date Wed, 4 Jun 2014 17:30:38 +1000
Subject Re: Benefits of asyncio
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.10687.1401867048.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401867048 news.xs4all.nl 2955 [2001:888:2000:d::a6]:45269
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72609

Show key headers only | View raw


On Wed, Jun 4, 2014 at 3:10 PM, Burak Arslan <burak.arslan@arskom.com.tr> wrote:
> Ah ok. Well, a couple of years of writing async code, my not-so-objective
> opinion about it is that it forces you to split your code into functions,
> just like Python forces you to indent your code properly. This in turn
> generally helps the quality of the codebase.

That's entirely possible, but it depends hugely on your
library/framework, then - see earlier comments in this thread about
Node.js and the nightmare of callbacks.

One thing I'm seeing, though, the more different styles of programming
I work with, is that since it's possible to write good code in pretty
much anything (even PHP, and my last boss used that as a
counter-argument to "PHP sucks"), and since a good programmer will
write good code in anything, neither of these is really a good
argument in favour of (or against) a feature/library/framework/style.
Python forces you to indent your code. Fine! But a good programmer
will already indent, and a sloppy programmer isn't forced to be
consistent. (At worst, you just add "if True:" every time you
unexpectedly indent.) To judge the quality of a framework based on
code style, you need to look at a *bad* programmer and what s/he
produces. A bad programmer, with just GOTO and line numbers, will
often produce convoluted code that's completely unreadable; a bad
programmer with a good suite of structured control flow will more
generally stumble to something that's at least mostly clear.

So how does async vs threaded stack up there? A competent programmer
won't have a problem with either model. A mediocre programmer probably
will think about one thing at a time, and will then run into problems.
Threading produces these problems in one set of ways, asyncio produces
problems in another set of ways. Which one would you, as an expert,
prefer to deal with in a junior programmer's code?

ChrisA

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


Thread

Benefits of asyncio Aseem Bansal <asmbansal2@gmail.com> - 2014-06-02 10:40 -0700
  Re: Benefits of asyncio Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-02 12:37 -0600
  Re: Benefits of asyncio Terry Reedy <tjreedy@udel.edu> - 2014-06-02 16:07 -0400
    Re: Benefits of asyncio Roy Smith <roy@panix.com> - 2014-06-02 16:19 -0400
    Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-02 23:28 +0300
      Re: Benefits of asyncio Paul Rubin <no.email@nospam.invalid> - 2014-06-02 13:45 -0700
        Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 07:49 +1000
        Re: Benefits of asyncio Terry Reedy <tjreedy@udel.edu> - 2014-06-02 21:51 -0400
        Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 09:36 +0300
          Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 18:47 +1000
            Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 12:10 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 19:30 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 13:08 +0300
                Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 20:23 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 14:12 +0300
                Re: Benefits of asyncio Paul Rubin <no.email@nospam.invalid> - 2014-06-04 00:52 -0700
              Re: Benefits of asyncio Burak Arslan <burak.arslan@arskom.com.tr> - 2014-06-03 14:05 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 21:57 +1000
              Re: Benefits of asyncio Burak Arslan <burak.arslan@arskom.com.tr> - 2014-06-04 08:10 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-04 17:30 +1000
              Re: Benefits of asyncio Paul Rubin <no.email@nospam.invalid> - 2014-06-04 00:48 -0700
          Re: Benefits of asyncio "Frank Millman" <frank@chagford.com> - 2014-06-03 13:09 +0200
          Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 22:01 +1000
            Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 16:05 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 23:31 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 16:42 +0300
                Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 23:49 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 19:18 +0300
              Re: Benefits of asyncio Roy Smith <roy@panix.com> - 2014-06-03 11:40 -0400
        Re: Benefits of asyncio Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-03 11:31 +0300
  Re: Benefits of asyncio Burak Arslan <burak.arslan@arskom.com.tr> - 2014-06-03 00:07 +0300
  Re: Benefits of asyncio Aseem Bansal <asmbansal2@gmail.com> - 2014-06-02 21:54 -0700

csiph-web