Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'frameworks': 0.05; '21,': 0.07; 'happen,': 0.07; 'python': 0.09; 'agrees': 0.09; 'counting': 0.09; 'excluding': 0.09; 'metrics': 0.09; 'def': 0.10; 'read.': 0.13; 'language': 0.14; 'essential': 0.15; 'attention,': 0.16; 'chris,': 0.16; 'contrived': 0.16; 'perfect.': 0.16; 'pushes': 0.16; 'readability.': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'code.': 0.20; 'to:name:python-list@python.org': 0.20; 'skip:- 40': 0.21; 'thanks.': 0.21; 'regardless': 0.21; 'assuming': 0.22; 'controlled': 0.22; 'statement': 0.23; 'this:': 0.23; 'to:2**1': 0.23; 'project,': 0.24; 'header:In-Reply-To:1': 0.25; 'setting': 0.26; 'set.': 0.27; 'lines': 0.28; 'overhead': 0.29; 'date:': 0.29; 'url:mailman': 0.29; 'source': 0.29; 'code': 0.31; 'point': 0.31; 'url:python': 0.32; 'url:listinfo': 0.32; 'material': 0.33; 'from:addr:live.com': 0.33; 'to:addr:python-list': 0.33; 'agree': 0.34; 'wrong': 0.34; 'list': 0.35; 'nov': 0.35; 'principal': 0.35; 'open': 0.35; 'pm,': 0.35; 'there': 0.35; 'subject:': 0.36; 'serve': 0.36; 'but': 0.36; 'url:org': 0.36; 'depends': 0.36; 'email addr:python.org': 0.36; 'too': 0.36; 'bad': 0.37; 'level': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'easier': 0.38; 'things': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'short': 0.39; 'where': 0.40; 'end': 0.40; 'url:mail': 0.40; 'your': 0.60; 'you.': 0.61; 'face': 0.61; 'bring': 0.62; "you'll": 0.62; 'email name:python-list': 0.62; 'email addr:gmail.com': 0.63; 'strategy': 0.64; 'choose': 0.65; 'results': 0.65; 'of:': 0.65; 'teach': 0.69; 'benefit': 0.70; 'goal': 0.74; 'score': 0.75; '+1100': 0.84; 'complexity': 0.84; 'dense': 0.84; 'excessive': 0.84; 'forward,': 0.84; 'charset:windows-1251': 0.97 X-Originating-IP: [194.44.213.194] X-EIP: [mUgGWtZ/IgdpSfXkT1dQ04rP+kkyw0Kw] X-Originating-Email: [andriy.kornatskyy@live.com] From: Andriy Kornatskyy To: , "python-list@python.org" Subject: RE: Web Frameworks Excessive Complexity Date: Wed, 21 Nov 2012 14:45:48 +0300 Importance: Normal In-Reply-To: References: , , , , <50ac31dd$0$29987$c3e8da3$5496439d@news.astraweb.com>, <67gun9-kk8.ln1@satorlaser.homedns.org>, , Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 21 Nov 2012 11:45:48.0207 (UTC) FILETIME=[BFBBD3F0:01CDC7DD] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 66 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353498416 news.xs4all.nl 6916 [2001:888:2000:d::a6]:40707 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33720 Chris=2C The focus of development team is controlled by setting a metric=A0threshold= or just excluding some. So you do not have an overhead for the development= team from the point it set forward=2C assuming them team committed to=A0ad= herence=A0it. Your strategy for perfection may vary.=A0You can start with 8 for CC in new= project=2C or with a higher level of 15 in an existing project. Where you = end up / the team agrees upon=2C depends on team commitment to the goal you= set. There is no gold median=2C there is just recommendation=2C how you fl= uctuate from it and what reason you face with depends on team. Thanks. Andriy ---------------------------------------- > Date: Wed=2C 21 Nov 2012 22:21:23 +1100 > Subject: Re: Web Frameworks Excessive Complexity > From: rosuav@gmail.com > To: python-list@python.org > > On Wed=2C Nov 21=2C 2012 at 10:09 PM=2C Andriy Kornatskyy > wrote: > > We choose Python for its readability. This is essential principal of la= nguage and thousands around reading the open source code. Things like PEP8= =2C CC=2C LoC are all to serve you one purpose: bring your attention=2C tea= ch you make your code better. > > But too much focus on metrics results in those metrics improving > without any material benefit to the code. If there's a number that you > can watch going up or down=2C nobody's going to want to be the one that > pushes that number the wrong direction. So what happens when the right > thing to do happens to conflict with the given metric? And yes=2C it > WILL happen=2C guaranteed. No metric is perfect. > > Counting lines of code teaches you to make dense code. That's not a > good thing nor a bad thing=3B you'll end up with list comprehensions > rather than short loops=2C regardless of which is easier to actually > read. > > Counting complexity by giving a score to every statement encourages > code like this: > > def bletch(x=2Cy): > return x + {"foo":y*2=2C"bar":x*3+y=2C"quux":math.sin(y)}.get(mode=2C0) > > instead of: > > def bletch(x=2Cy): > if mode=3D=3D"foo": return x+y*2 > if mode=3D=3D"bar": return x*4+y > if mode=3D=3D"quux": return x+math.sin(y) > return x > > Okay=2C this is a stupid contrived example=2C but tell me which of those > you'd rather work with=2C and then tell me a plausible metric that would > agree with you. > > ChrisA > -- > http://mail.python.org/mailman/listinfo/python-list =