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


Groups > comp.lang.python > #33786

Re: Web Frameworks Excessive Complexity

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <modulok@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '21,': 0.07; 'computed': 0.07; 'nicely': 0.07; 'counting': 0.09; 'oh,': 0.09; 'cc:addr :python-list': 0.10; 'def': 0.10; 'contrived': 0.16; 'mathematics.': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'cheap': 0.17; '>>>': 0.18; 'translate': 0.20; 'cc:2**0': 0.23; 'statement': 0.23; 'this:': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'i.e.': 0.27; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'chris': 0.28; 'agreed.': 0.29; "d'aprano": 0.29; 'peer': 0.29; 'steven': 0.29; "i'm": 0.29; 'code': 0.31; 'not.': 0.32; 'received:209.85.160.46': 0.32; 'received:google.com': 0.34; 'project': 0.34; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'science': 0.38; 'instead': 0.39; 'easily': 0.39; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'of:': 0.65; 'quality': 0.69; 'score': 0.75; '10:43': 0.84; 'borrow': 0.84; 'complexity': 0.84; 'glad': 0.86; 'audit': 0.93
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 :cc:content-type; bh=FS4Mq2cmMfpYegHoQMFom8gp8T+rfb4uAZmKDiDH2Es=; b=VbU1B5jyZZPQ7fukZ2SwQuuMtXMpW2agVeOL7OXNdQ+9NqrS6G0+iyJh4e5+1qp1Hz VZJ1TWiLkoRWZ6Afv45r+U/GL09wiigr51tSW3G3S2s68Rhy9cMM1ZJATs2WzPgYYes0 pciX2fMcetDGUm/DpiGdj1zyC9TQ6kSkKmTMHthdIe61d8Pw2DzKq6loQCVWLwrzIomf tGJ9avOYMUXWT1I9EFTIJFXTMiqJ71WRa7uHapKw6Lm9Y6oUJlbhWoIpcTgmgNCPuJCK 148ZDM0M70Pc5/pr+sIsWm5Sk/kY75eJgojrUK8W2yyEqqsOWGYGc5rIZISF2Gpb8jLb kSDQ==
MIME-Version 1.0
In-Reply-To <CAPTjJmqymF7ucE9ptjCVxu9hwsTVCDVXNX+QHyNk18W4qvSp7w@mail.gmail.com>
References <DUB117-W665C7556168028384DCC6791550@phx.gbl> <k8glsd$vfk$1@ger.gmane.org> <DUB117-W66187DFCFCCDBA9E2710E091550@phx.gbl> <mailman.85.1353442093.29569.python-list@python.org> <50ac31dd$0$29987$c3e8da3$5496439d@news.astraweb.com> <67gun9-kk8.ln1@satorlaser.homedns.org> <DUB117-W33D7E1124EE9D7B659E50991540@phx.gbl> <mailman.140.1353496885.29569.python-list@python.org> <50acbe4e$0$29987$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmqymF7ucE9ptjCVxu9hwsTVCDVXNX+QHyNk18W4qvSp7w@mail.gmail.com>
Date Wed, 21 Nov 2012 22:22:54 -0700
Subject Re: Web Frameworks Excessive Complexity
From Modulok <modulok@gmail.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.193.1353561778.29569.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353561778 news.xs4all.nl 6858 [2001:888:2000:d::a6]:54645
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33786

Show key headers only | View raw


> On Wed, Nov 21, 2012 at 10:43 PM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> wrote:
>> On Wed, 21 Nov 2012 22:21:23 +1100, Chris Angelico wrote:
>>
>>> Counting complexity by giving a score to every statement encourages code
>>> like this:
>>>
>>> def bletch(x,y):
>>>   return x + {"foo":y*2,"bar":x*3+y,"quux":math.sin(y)}.get(mode,0)
>>>
>>> instead of:
>>>
>>> def bletch(x,y):
>>>   if mode=="foo": return x+y*2
>>>   if mode=="bar": return x*4+y
>>>   if mode=="quux": return x+math.sin(y) return x
>>>
>>> Okay, this is a stupid contrived example, but tell me which of those
>>> you'd rather work with
>>
>>

> Oh, I'm *so* glad I work in a small company.

Agreed. Do we rate a contractor's quality of workmanship and efficiency by the
number of nails he drives?

Of course not. That would be ridiculous.

A better metric of code quality and complexity would be to borrow from science
and mathematics. i.e. a peer review or audit by others working on the project
or in the same field of study. Unfortunately this isn't cheap or easily
computed and doesn't translate nicely to a bar graph.

Such is reality.
-Modulok-

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


Thread

Re: Web Frameworks Excessive Complexity Robert Kern <robert.kern@gmail.com> - 2012-11-20 20:07 +0000
  Re: Web Frameworks Excessive Complexity Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 01:43 +0000
    Re: Web Frameworks Excessive Complexity Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-11-21 09:33 +0100
      RE: Web Frameworks Excessive Complexity Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2012-11-21 14:09 +0300
      Re: Web Frameworks Excessive Complexity Chris Angelico <rosuav@gmail.com> - 2012-11-21 22:21 +1100
        Re: Web Frameworks Excessive Complexity Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 11:43 +0000
          RE: Web Frameworks Excessive Complexity Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2012-11-21 14:47 +0300
          Re: Web Frameworks Excessive Complexity Chris Angelico <rosuav@gmail.com> - 2012-11-22 09:12 +1100
          Re: Web Frameworks Excessive Complexity Modulok <modulok@gmail.com> - 2012-11-21 22:22 -0700
      RE: Web Frameworks Excessive Complexity Andriy Kornatskyy <andriy.kornatskyy@live.com> - 2012-11-21 14:45 +0300
    Re: Web Frameworks Excessive Complexity Robert Kern <robert.kern@gmail.com> - 2012-11-21 11:47 +0000

csiph-web