On Tue, Feb 9, 2010 at 9:36 PM, Tim Chase <python.l...@tim.thechases.com>wrote:

> removing the "not" from the condition.  I admit I choose one over the other
> based on some gut-feeling aesthetic that I can't really nail down.  I think
> one of my major influencing factors revolves around the negative "not"
> portion having one or two lines and the  positive portion having a large
> block of code.


If one block is much shorter, I tend to put the shorter block first.  That
way, the "else" and the "if" are almost always on the screen together at the
same time.  If they're both long, I factor out one or both of the blocks
into functions.

--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com/>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to