Re: Web Frameworks Excessive Complexity

2012-11-22 Thread Thomas Bach
On Wed, Nov 21, 2012 at 12:49:52PM -0800, rh wrote: wheezy + myvirtualenv = 3.3MB pyramid = 92MB $ mkvirtualenv --no-site-packages -p python2.7 pyramid $ pip install -U distribute $ pip install pyramid $ du -h .virtualenvs/pyramid 22M .virtualenvs/pyramid $ du -s

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Ulrich Eckhardt
Am 21.11.2012 02:43, schrieb Steven D'Aprano: On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote: The source of bugs is not excessive complexity in a method, just excessive lines of code. Taken literally, that cannot possibly the case. def method(self, a, b, c): do_this(a)

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
. Thanks. Andriy To: python-list@python.org From: robert.k...@gmail.com Subject: Re: Web Frameworks Excessive Complexity Date: Tue, 20 Nov 2012 20:33:46 + On 20/11/2012 20:22, Andriy Kornatskyy wrote: Robert, I respect your point of view

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
From: ulrich.eckha...@dominolaser.com Subject: Re: Web Frameworks Excessive Complexity Date: Wed, 21 Nov 2012 09:33:09 +0100 To: python-list@python.org Am 21.11.2012 02:43, schrieb Steven D'Aprano: On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote: The source of bugs

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Steven D'Aprano
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

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
. Thanks. Andriy Date: Wed, 21 Nov 2012 22:21:23 +1100 Subject: Re: Web Frameworks Excessive Complexity From: ros...@gmail.com To: python-list@python.org On Wed, Nov 21, 2012 at 10:09 PM, Andriy Kornatskyy andriy.kornats...@live.com wrote: We

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Robert Kern
On 21/11/2012 01:43, Steven D'Aprano wrote: On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote: The source of bugs is not excessive complexity in a method, just excessive lines of code. Taken literally, that cannot possibly the case. def method(self, a, b, c): do_this(a)

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
I believe for the quality of code you produce. Thanks. Andriy From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Web Frameworks Excessive Complexity Date: Wed, 21 Nov 2012 11:43:10 + To: python-list@python.org On Wed, 21 Nov 2012 22:21

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Robert Kern
On 21/11/2012 11:02, Andriy Kornatskyy wrote: Robert, You would never get a better product by accident. The meaning of better product might differ from team to team but you can not ignore excessive complexity. Earlier or later you get back to that code and refactor it, thus existence of

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
analysis give you an initial picture, how it fits with your own vision, etc. Convince or accept? Andriy Kornatskyy To: python-list@python.org From: robert.k...@gmail.com Subject: Re: Web Frameworks Excessive Complexity Date: Wed, 21 Nov 2012 11:54:06 +

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Robert Kern
On 21/11/2012 12:17, Andriy Kornatskyy wrote: Agreed. I think we have pretty much the same point of view on this. All these metrics advise you... this is again depends how you look at this. If you are a new comer to a project, you usually spend some time on code review, talk to people, read

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
Frameworks Excessive Complexity Date: Wed, 21 Nov 2012 12:26:26 + On 21/11/2012 12:17, Andriy Kornatskyy wrote: Agreed. I think we have pretty much the same point of view on this. All these metrics advise you... this is again depends how you look at this. If you are a new comer

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Robert Kern
On 21/11/2012 12:47, Andriy Kornatskyy wrote: Hm... what serves an evidence purpose for you? Well-done empirical studies, like the one I gave you. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Chris Rebert
On Wed, Nov 21, 2012 at 9:49 AM, rh richard_hubb...@lavabit.com wrote: On Tue, 20 Nov 2012 20:41:42 +0300 Andriy Kornatskyy andriy.kornats...@live.com wrote: Cyclomatic (or conditional) complexity is a metric used to indicate the complexity of a source code. Excessive complexity is something

RE: Web Frameworks Excessive Complexity

2012-11-21 Thread Andriy Kornatskyy
Kornatskyy To: python-list@python.org From: richard_hubb...@lavabit.com Subject: Re: Web Frameworks Excessive Complexity Date: Wed, 21 Nov 2012 09:49:39 -0800 On Tue, 20 Nov 2012 20:41:42 +0300 Andriy Kornatskyy andriy.kornats...@live.com wrote

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Chris Rebert
On Wed, Nov 21, 2012 at 10:57 AM, rh richard_hubb...@lavabit.com wrote: On Wed, 21 Nov 2012 10:12:26 -0800 Chris Rebert c...@rebertia.com wrote: On Wed, Nov 21, 2012 at 9:49 AM, rh richard_hubb...@lavabit.com wrote: On Tue, 20 Nov 2012 20:41:42 +0300 Andriy Kornatskyy

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Chris Angelico
On Wed, Nov 21, 2012 at 10:43 PM, Steven D'Aprano steve+comp.lang.pyt...@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 +

Re: Web Frameworks Excessive Complexity

2012-11-21 Thread Modulok
On Wed, Nov 21, 2012 at 10:43 PM, Steven D'Aprano steve+comp.lang.pyt...@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 +

Web Frameworks Excessive Complexity

2012-11-20 Thread Andriy Kornatskyy
Cyclomatic (or conditional) complexity is a metric used to indicate the complexity of a source code. Excessive complexity is something that is beyond recommended level of 10 (threshold that points to the fact the source code is too complex and refactoring is suggested). Here is a list of web

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Robert Kern
On 20/11/2012 17:41, Andriy Kornatskyy wrote: Cyclomatic (or conditional) complexity is a metric used to indicate the complexity of a source code. Excessive complexity is something that is beyond recommended level of 10 (threshold that points to the fact the source code is too complex and

RE: Web Frameworks Excessive Complexity

2012-11-20 Thread Andriy Kornatskyy
coverage with unit tests) thus have certain degree of interest to both: end users and framework developers. Thanks. Andriy Kornatskyy To: python-list@python.org From: robert.k...@gmail.com Subject: Re: Web Frameworks Excessive Complexity Date: Tue, 20

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Robert Kern
On 20/11/2012 19:46, Andriy Kornatskyy wrote: Robert, Thank you for the comment. I do not try relate CC with LOC. Instead pointing to excessive complexity, something that is beyond recommended threshold, a subject to refactoring in respective web frameworks. Those areas are likely to be

RE: Web Frameworks Excessive Complexity

2012-11-20 Thread Andriy Kornatskyy
To: python-list@python.org From: robert.k...@gmail.com Subject: Re: Web Frameworks Excessive Complexity Date: Tue, 20 Nov 2012 20:07:54 + On 20/11/2012 19:46, Andriy Kornatskyy wrote: Robert, Thank you for the comment. I do not try relate

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Robert Kern
On 20/11/2012 20:22, Andriy Kornatskyy wrote: Robert, I respect your point of view and it definitely make sense to me. I personally do not have a problem to understand CC but agree, method LoC is easier to understand. Regardless the path your choose in your next refactoring (based on method

Re: Web Frameworks Excessive Complexity

2012-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote: The source of bugs is not excessive complexity in a method, just excessive lines of code. Taken literally, that cannot possibly the case. def method(self, a, b, c): do_this(a) do_that(b) do_something_else(c) def method(self,