Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Web Frameworks Excessive Complexity

Thread Tools

RE: Web Frameworks Excessive Complexity

Andriy Kornatskyy
Posts: n/a


The focus of development team is controlled by setting a metric*thresholdor just excluding some. So you do not have an overhead for the developmentteam from the point it set forward, assuming them team committed to*adherence*it.

Your strategy for perfection may vary.*You can start with 8 for CC in newproject, or with a higher level of 15 in an existing project. Where you end up / the team agrees upon, depends on team commitment to the goal youset. There is no gold median, there is just recommendation, how you fluctuate from it and what reason you face with depends on team.



> Date: Wed, 21 Nov 2012 22:21:23 +1100
> Subject: Re: Web Frameworks Excessive Complexity
> From: Removed)
> To: (E-Mail Removed)
> On Wed, Nov 21, 2012 at 10:09 PM, Andriy Kornatskyy
> <(E-Mail Removed)> wrote:
> > We choose Python for its readability. This is essential principal of language and thousands around reading the open source code. Things like PEP8, CC, LoC are all to serve you one purpose: bring your attention, teach 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, 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, it
> WILL happen, 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; you'll end up with list comprehensions
> rather than short loops, regardless of which is easier to actually
> read.
> Counting complexity by giving a score to every statement encourages
> code like this:
> def bletch(x,y):
> return x + {"foo":y*2,"bar"*3+y,"quux":math.sin(y)}.get(mod e,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, and then tell me a plausible metric that would
> agree with you.
> ChrisA
> --

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Web Frameworks Excessive Complexity Robert Kern Python 7 11-22-2012 05:22 AM
RE: Web Frameworks Excessive Complexity Andriy Kornatskyy Python 0 11-20-2012 08:22 PM
RE: Web Frameworks Excessive Complexity Andriy Kornatskyy Python 0 11-20-2012 07:46 PM
Re: Web Frameworks Excessive Complexity Robert Kern Python 0 11-20-2012 07:32 PM