Hi Dominique,

I'm glad to have elicited some discussion :-)
The syntax depends not only on associativity, but on precedence as well.
The only place where precedence could be misleading are bitwise operations
[1] (for backwards compatibility :-)
So, my rule was simple: an "if ((..." with multiple leading parens is only
necessary where the logical condition is indeed complex.

Gintas

[1] http://www.perlmonks.org/?node_id=1159769

2017-12-08 9:53 GMT+01:00 Dominique Devienne <ddevie...@gmail.com>:

> On Fri, Dec 8, 2017 at 7:53 AM, <gin...@apache.org> wrote:
>
> > Repository: ant-ivy
> > Updated Branches:
> >   refs/heads/master 1b84f2ee7 -> 12aeeec70
> >
> > tidy up the code
> > -            if ((currentTask.getTaskName() != null)
> > +            if (currentTask.getTaskName() != null
> >                      && currentTask.getTaskName().equals(((Task)
> > task).getTaskName())) {
> >                  // The current AntMessageLogger already logs with the
> same
> >                  // prefix as the given task. So we shouldn't do
> > anything...
> > ...
> >
>
>
> > -        if ((otherRef != null) && OVERRIDE_NOT_ALLOWED.equals(
> override))
> > {
> > +        if (otherRef != null && OVERRIDE_NOT_ALLOWED.equals(override))
> {
> >
>
> Hi Gintas,
>
> Why? I myself prefer having the parens you removed.
> Is this some kind of automated code formatter? Or personnal preference?
> I've never been one to rely on implicit associativity rule, and like
> explicit parens in those cases.
>
> It's not a -1, but maybe we could have a short conversation here on whether
> this is desirable or not,
> or even if people just don't care.
>
> Thanks, --DD
>

Reply via email to