Syntax patterns: more statistics.

Mark Mahieu markmahieu at
Tue Apr 21 01:04:14 PDT 2009

That's a good idea, although again we'd need to be very careful about
interpreting the results.  For example, if we look at uses of both ?: and ?.
in Groovy code, we should note that the Elvis operator is a relatively
recent addition to the language, whereas the safe-navigation operator has
been supported for much longer.  In addition, much of the Groovy code I've
seen uses the safe-navigation operator in ways that are not supported by the
coin proposal.

2009/4/21 Ruslan Shevchenko <Ruslan at>

> > It is indeed good work, but like all metrics, these measurements need
> > to be treated as rough indicators rather than firm values.  The
>  Yes.
> > Jackpot project (an automated refactoring tool) had a rule to change
> > if statements to conditional expressions -- it found a lot of
> > candidates, but most were rejected by developers using the tool.  When
> > asked, developers gave readability as the primary concern, stating
> > that it was worth some verbiage to make the code easier to read.  My
> > hunch is that a lot of potential elvis uses will be rejected for
> > similar reasons.
> >
> Yes.
>  How we can count this: look at languages where elvis implemented and
> find percentage of applicability. What we need for this (?) - just parser.
> So, in priniciple if exists publicy aviable groovy or C# parser (or
> compiler/interpreter which provide access to AST), we can try hack one, to
> count unused possibilities and expect that in java number would be near.
> > Tom

More information about the coin-dev mailing list