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


Groups > comp.lang.python > #33773

Re: Web Frameworks Excessive Complexity

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; '21,': 0.07; 'salary,': 0.07; 'counting': 0.09; 'differing': 0.09; 'metrics': 0.09; 'oh,': 0.09; 'looked': 0.10; 'def': 0.10; 'programmer': 0.11; 'contrived': 0.16; 'debates': 0.16; 'enough.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'recognizing': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'received:209.85.214.174': 0.21; 'specified': 0.23; 'statement': 0.23; 'this:': 0.23; 'thus': 0.24; "we'd": 0.24; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'lines': 0.28; 'chris': 0.28; "d'aprano": 0.29; 'steven': 0.29; "i'm": 0.29; 'code': 0.31; '(and': 0.32; 'gets': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'be.': 0.36; 'programmers': 0.36; "wasn't": 0.36; "didn't": 0.36; 'should': 0.36; 'being': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'things': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'kind': 0.61; 'more': 0.63; 'management': 0.65; 'boss': 0.65; 'of:': 0.65; 'hour': 0.69; 'quality': 0.69; 'hoping': 0.72; 'score': 0.75; '10:43': 0.84; 'actually,': 0.84; 'complexity': 0.84; 'glad': 0.86; 'good,': 0.91
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 :content-type; bh=N/noBx74IUICWrfgOFfp7yan5r1sBnLE39VBq/maT4o=; b=OzZLweEX0yZ7FPr90WAm+ZfJLao7pq7QWv8riUR6Gjd67E2fKCXxfmVykaUluRAQ0B CjxKVBpWDGA+YF0WhwF7ZOZjTCGHrpd1XF2jU0h+bgpiEe0XwjiBED4mKXr2rx/wOE71 YfWH2paQB8anxwjvj3zSj1839wtGg8aGkPuufp7DVeaav4wD0pEZiBDDKESQsAiwWkVh HoxvhaJHrO6VBraufMUJrA7ZY1Wb+ydgcMFRwfEQzfvr2upnSmc+kYYOX3Hgf9WT/fOj nZMlrq8jcf1A40wnf2w2CA4EUo/iEzm/rUc4ucod/Bq8x41SANgCJhoRu1ea8msPHXXm rIbw==
MIME-Version 1.0
In-Reply-To <50acbe4e$0$29987$c3e8da3$5496439d@news.astraweb.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>
Date Thu, 22 Nov 2012 09:12:53 +1100
Subject Re: Web Frameworks Excessive Complexity
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.179.1353535976.29569.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353535976 news.xs4all.nl 6859 [2001:888:2000:d::a6]:45527
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33773

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
>
>
> Am I being paid by the hour or the line?

You're on a salary, but management specified some kind of code metrics
as a means of recognizing which of their programmers are more
productive, and thus who gets promoted.

Oh, I'm *so* glad I work in a small company. We've only had one
programmer that we "let go" (and actually, it was literally letting
him go - he said he was no good, hoping that we'd beg him to stay, and
we simply didn't beg him to stay), and the metric of code quality was
simply that both my boss and I looked at his code and said that it
wasn't good enough. Much simpler. (Though my boss and I have differing
views on how many lines of code some things should be. We end up
having some rather amusing debates about trivial things like line
breaks.)

ChrisA

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