[openstack-dev] [style] () vs \ continuations
vishvananda at gmail.com
Tue Nov 19 01:23:15 UTC 2013
On Nov 14, 2013, at 10:00 AM, Monty Taylor <mordred at inaugust.com> wrote:
> On 11/13/2013 08:08 PM, Robert Collins wrote:
>> On 14 November 2013 13:59, Sean Dague <sean at dague.net> wrote:
>>> This is an area where we actually have consensus in our docs (have had
>>> for a while), the reviewer was being consistent with them, and it feels
>>> like you are reopening that for personal preference.
>> Sorry that it feels that way. My personal code also uses ()
>> overwhelmingly - so this isn't a personal agenda issue. I brought it
>> up because the person that wrote the code had chosen to use \, and as
>> far as I knew we didn't have a hard decision either way - and the
>> style guide we have talks preference not requirement, but the review
>> didn't distinguish between whether it's a suggestion or a requirement.
>> I'm seeking clarity so I can review more effectively and so that our
>> code doesn't end up consistent but hard to read.
> I'd say we've got an expression of clarity here - which means
> potentially a patch to the hacking guide to clarify the language on what
> our choice is, as well as the addition of a hacking check to enforce it
> would be in bounds.
+1 to sticking something in hacking. FWIW I would probably do the following
to avoid the debate altogether:
result = self._path_file_exists(ds_browser, folder_path, file_name)
folder_exists, file_exists, file_size_in_kb, disk_extents = result
>>> Honestly I find \ at the end of a line ugly as sin, and completely
>>> jarring to read. I actually do like the second one better. I don't care
>>> enough to change a policy on it, but we do already have a policy, so it
>>> seems pretty pedantic, and not useful.
>> Ok, thats interesting. Readability matters, and if most folk find that
>> even this case - which is pretty much the one case where I would argue
>> for \ - is still easier to read with (), then thats cool.
>>> Bringing up for debate the style guide every time it disagrees with your
>>> personal preference isn't a very effective use of people's time.
>>> Especially on settled matters.
>> Totally not what I'm doing. I've been told that much of our style
>> guide was copied lock stock and barrel from some Google Python style
>> guide, so I can't tell what is consensus and what is 'what someone
>> copied down one day'. Particularly when there is no rationale included
>> against the point - its a black box and entirely opaque.
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
More information about the OpenStack-dev