<p></p>
<p dir="auto">Sure, I can see that and I can usually remember the rules too. But I think it becomes more useful here to use brackets when we're not talking about simple mathematical symbols. There's a fair amount of complexity when reading things like:</p>
<pre><code>... captures[1].to_f
... captures[1].to_f + captures[2].to_f
... captures[1].to_f + captures[2].to_f / 60
</code></pre>
<p dir="auto">I mean, you need to read the captures bit, then think about the array access, then converting it to a float, and then keep on reading in case there's a higher-precedence operator still to follow. Similarly for the max_friends calculations:</p>
<pre><code>max_friends = account_age_in_hours.ceil + recent_friends - active_reports * 10
</code></pre>
<p dir="auto">It's a lot of stuff to read and mentally juggle before you get to the multiplication, because each part of the calculation is not just a simple symbol like <code>x y z i j k</code> etc.</p>
<p dir="auto">So I think the braces are worthwhile in giving a heads-up that something is being done out-of-order, given the complexity of reading some of the components in these lines. And I don't think the extraneous braces make the other lines any harder to read.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3523#issuecomment-1090498269">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJLL6VD7G3K7T5OUMDVDW7VBANCNFSM5SWUBCAA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMNRZBOZPJBX2ZWSV3VDW7VBA5CNFSM5SWUBCAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOID725XI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/3523/c1090498269</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3523#issuecomment-1090498269",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3523#issuecomment-1090498269",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>