<font face="arial" size="2"><p style="margin:0;padding:0;">+1</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">-----Original Message-----<br />From: "Mark McLoughlin" <markmc@redhat.com><br />Sent: Thursday, January 31, 2013 3:56pm<br />To: "OpenStack Development Mailing List" <openstack-dev@lists.openstack.org><br />Subject: Re: [openstack-dev] "if X not in Y" vs. "if not X in Y" consensus?<br /><br /></p>
<div id="SafeStyles1360010080">
<p style="margin:0;padding:0;">On Thu, 2013-01-31 at 12:32 -0800, Maru Newby wrote:<br />> Hi all,<br />> <br />> I'm the reviewer that prompted Zhongyue Luo to ask this question on<br />> the mailing list, and would like to chime in.<br />> <br />> As has been noted on this thread, not only are the two forms logically<br />> equivalent, but they also produce the same byte code. The only reason<br />> to mandate one over the other would be 'readability'. I would<br />> suggest, though, that the minimal increase in so-called readability<br />> does not justify requiring reviewers to enforce this style rule.<br />> <br />> That is not to say that I think code consistency is without value -<br />> quite the opposite. I subscribe to Ableson/Sussman's view that<br />> "Programs must be written for people to read, and only incidentally<br />> for machines to execute." I do think, however, that the effort<br />> required to enforce a given rule should be weighed carefully against<br />> the value that its enforcement brings. I'm not of the opinion that<br />> manual effort is justified in this particular case. If the community<br />> consensus is that this rule needs to be enforced, I suggest that it be<br />> done through automatic detection (ala pep8), or even automatic<br />> correction (ala the kinds of code reformatting tools that are<br />> pervasive in c/c++ land).<br /><br />How about this as a conclusion?<br /><br />We generally prefer "X not in Y", but few think it's a big deal.<br /><br />Reviewers don't need to enforce this, but they shouldn't be recommending<br />"not X in Y" either.<br /><br />If anyone feels like taking on the janitorial task of removing uses of<br />"not X in Y" from code occasionally, that's totally cool.<br /><br />If someone wants to write a hacking.py check for this, that's totally<br />cool too.<br /><br />Cheers,<br />Mark.<br /><br /><br />_______________________________________________<br />OpenStack-dev mailing list<br />OpenStack-dev@lists.openstack.org<br />http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</p>
</div></font>