[VOTE] Support Java-like array

classic Classic list List threaded Threaded
29 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[VOTE] Support Java-like array

Daniel.Sun
Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
 0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

paulk_asert
+1 with the following provisos:
* we need to update the breaking changes section of 3.0.0 release notes on the website (site/src/site/releasenotes/groovy-3.0.adoc) to include the cases listed in GROOVY-8561
* we need to update the "Array initializers" section of core-differences-java.adoc (we need to explain what cases remain - obviously if no array type is specified is one case - I haven't checked whether Java allows arrays of lambdas or something similar which we may not support - I don't believe so but haven't researched into it)
* we need to update the "Arrays" section of core-syntax.adoc (I think we need to indicate that square brackets is the idiomatic approach and also explicitly say that closure is the default interpretation of curly braces unless the array target type can be inferred from the context.)

I think it is probably worth adding the last two into the PR for any future reviewers. We should also update the "Lists" section of core-syntax.adoc to include information about Groovy's auto promotion of a single item into an array. I guess that isn't really part of this change but since that is where the breaking changes changes will be for the degenerate edge cases, I think we had better make that clearer.

I am happy to help with the wording in the doco changes (time permitting).

Cheers, Paul.


On Fri, May 4, 2018 at 11:38 AM, Daniel.Sun <[hidden email]> wrote:
Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
 0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

Daniel.Sun
Hi Paul,

     I've added your proposed provisos to the PR. Thanks for your voting.

Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun
MG
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

MG
In reply to this post by Daniel.Sun
+1 with all that Paul says. Plus, we should support emitting a "Java compatibility / non-idiomatic-Groovy" warning here, to avoid people using this "for Java compatibility / quick/easy copy & paste porting of Java code"-only syntax when writing actual Groovy code (surprisingly not all developers read the complete documentation of a language, before they start using it, especially for something as base line as literal array syntax :-) ).

With regards to Jochen's critique of warnings in general: I absolutely agree that too many / too picky warnings are bad. But obviously we cannot use an error here instead, so if we want to keep this syntax in the corner it belongs, warning about its use looks like the only option that would consistently work in practice to me...
(same as potentially for Java lambda syntax, depending on whether one will be able to use 100% equivalent & concise Groovy closure syntax here instead).

Cheers,
mg


-------- Ursprüngliche Nachricht --------
Von: "Daniel.Sun" <[hidden email]>
Datum: 04.05.18 03:38 (GMT+01:00)
Betreff: [VOTE] Support Java-like array

Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
MG
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

MG
In reply to this post by Daniel.Sun
+1 with all that Paul says. Plus, we should support emitting a "Java compatibility / non-idiomatic-Groovy" warning here, to avoid people using this "for Java compatibility / quick/easy copy & paste porting of Java code"-only syntax when writing actual Groovy code (surprisingly not all developers read the complete documentation of a language, before they start using it, especially for something as base line as literal array syntax :-) ).

With regards to Jochen's critique of warnings in general: I absolutely agree that too many / too picky warnings are bad. But obviously we cannot use an error here instead, so if we want to keep this syntax in the corner it belongs, warning about its use looks like the only option that would consistently work in practice to me...
(same as potentially for Java lambda syntax, depending on whether one will be able to use 100% equivalent & concise Groovy closure syntax here instead).

Cheers,
mg


-------- Ursprüngliche Nachricht --------
Von: "Daniel.Sun" <[hidden email]>
Datum: 04.05.18 03:38 (GMT+01:00)
Betreff: [VOTE] Support Java-like array

Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

paulk_asert
In reply to this post by Daniel.Sun
I would keep discussions about warnings in a separate thread so as not to derail the main topic here. If they were already widely used, it would be fine to indicate that we should just add another one. But that isn't the case and we'd need many discussions to do the topic justice.

Cheers, Paul.

On Fri, May 4, 2018 at 11:04 PM, mg <[hidden email]> wrote:
+1 with all that Paul says. Plus, we should support emitting a "Java compatibility / non-idiomatic-Groovy" warning here, to avoid people using this "for Java compatibility / quick/easy copy & paste porting of Java code"-only syntax when writing actual Groovy code (surprisingly not all developers read the complete documentation of a language, before they start using it, especially for something as base line as literal array syntax :-) ).

With regards to Jochen's critique of warnings in general: I absolutely agree that too many / too picky warnings are bad. But obviously we cannot use an error here instead, so if we want to keep this syntax in the corner it belongs, warning about its use looks like the only option that would consistently work in practice to me...
(same as potentially for Java lambda syntax, depending on whether one will be able to use 100% equivalent & concise Groovy closure syntax here instead).

Cheers,
mg


-------- Ursprüngliche Nachricht --------
Von: "Daniel.Sun" <[hidden email]>
Datum: 04.05.18 03:38 (GMT+01:00)
Betreff: [VOTE] Support Java-like array

Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

paulk_asert
I would like to see some more PMC votes for this proposal.

On the one hand we don't like changes that aren't vetted enough, yet here is a proposed change that:
* is fairly comprehensive (just lacking some doco which I have already identified)
* closes some gaps in one of Groovy's design goals of making it easy to bring Java code to Groovy
* has sought feedback from dev and user communities (and seems to have strong support from our user base)

And yet, I am the only one from the PMC who has voted. I don't really care if the votes
are critical and provide a good reason but at least then it shows respect for the time and
energy put in to preparing a considered proposal and requesting formal feedback.
I know everyone is super busy but we just aren't a big enough PMC right now for
everyone to sit on the fence for proposals like this.

While I don't think we need to mirror everything in Java and I don't personally think I will
use this feature often in my own code, I can certainly see how new users to Groovy would
find it useful and so it seems like an overall win from my point of view. Zero-learning curve
from Java is one of the attractions of Groovy when marketing the language. This seems to
offer a bit of an improvement in that space with low investment and low risk.

If others can see serious flaws though, it would be good to provide the feedback so Daniel
can make some progress. Or if someone can see better bang-for-buck changes that we
should be making from a marketing of the language perspective, it would be good to pass
those insights on so Daniel and other contributors can make best use of their time.


Cheers, Paul.


On Fri, May 4, 2018 at 11:31 PM, Paul King <[hidden email]> wrote:
I would keep discussions about warnings in a separate thread so as not to derail the main topic here. If they were already widely used, it would be fine to indicate that we should just add another one. But that isn't the case and we'd need many discussions to do the topic justice.

Cheers, Paul.

On Fri, May 4, 2018 at 11:04 PM, mg <[hidden email]> wrote:
+1 with all that Paul says. Plus, we should support emitting a "Java compatibility / non-idiomatic-Groovy" warning here, to avoid people using this "for Java compatibility / quick/easy copy & paste porting of Java code"-only syntax when writing actual Groovy code (surprisingly not all developers read the complete documentation of a language, before they start using it, especially for something as base line as literal array syntax :-) ).

With regards to Jochen's critique of warnings in general: I absolutely agree that too many / too picky warnings are bad. But obviously we cannot use an error here instead, so if we want to keep this syntax in the corner it belongs, warning about its use looks like the only option that would consistently work in practice to me...
(same as potentially for Java lambda syntax, depending on whether one will be able to use 100% equivalent & concise Groovy closure syntax here instead).

Cheers,
mg


-------- Ursprüngliche Nachricht --------
Von: "Daniel.Sun" <[hidden email]>
Datum: 04.05.18 03:38 (GMT+01:00)
Betreff: [VOTE] Support Java-like array

Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html


Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

Guillaume Laforge
Administrator
I haven't voted as I'm not a big fan of adding this syntax construct.

My feeling is that we shouldn't necessarily try to become a pure Java-superset, and it shouldn't be a goal to try more and more to close that gap.
There are some confusing cases where (single element) array initializers can be confounded with closures.

Also, I tend to prefer square brackets over curlies, but that's certainly a question of taste.

The other thing that slightly annoys me is that we're adding additional syntax for the same thing: array initializers, but look at how we added lambda notation.
How will we explain users why we have two syntaxes for the same thing? Or when/why they should use one over the other?

I guess with 15 years involved in various ways with Groovy, I'm also becoming more conservative with changes, and I fear that we might be making Groovy more / too complicated.

So I will vote, but only with +0.

Guillaume



On Mon, May 7, 2018 at 9:21 PM, Paul King <[hidden email]> wrote:
I would like to see some more PMC votes for this proposal.

On the one hand we don't like changes that aren't vetted enough, yet here is a proposed change that:
* is fairly comprehensive (just lacking some doco which I have already identified)
* closes some gaps in one of Groovy's design goals of making it easy to bring Java code to Groovy
* has sought feedback from dev and user communities (and seems to have strong support from our user base)

And yet, I am the only one from the PMC who has voted. I don't really care if the votes
are critical and provide a good reason but at least then it shows respect for the time and
energy put in to preparing a considered proposal and requesting formal feedback.
I know everyone is super busy but we just aren't a big enough PMC right now for
everyone to sit on the fence for proposals like this.

While I don't think we need to mirror everything in Java and I don't personally think I will
use this feature often in my own code, I can certainly see how new users to Groovy would
find it useful and so it seems like an overall win from my point of view. Zero-learning curve
from Java is one of the attractions of Groovy when marketing the language. This seems to
offer a bit of an improvement in that space with low investment and low risk.

If others can see serious flaws though, it would be good to provide the feedback so Daniel
can make some progress. Or if someone can see better bang-for-buck changes that we
should be making from a marketing of the language perspective, it would be good to pass
those insights on so Daniel and other contributors can make best use of their time.


Cheers, Paul.


On Fri, May 4, 2018 at 11:31 PM, Paul King <[hidden email]> wrote:
I would keep discussions about warnings in a separate thread so as not to derail the main topic here. If they were already widely used, it would be fine to indicate that we should just add another one. But that isn't the case and we'd need many discussions to do the topic justice.

Cheers, Paul.

On Fri, May 4, 2018 at 11:04 PM, mg <[hidden email]> wrote:
+1 with all that Paul says. Plus, we should support emitting a "Java compatibility / non-idiomatic-Groovy" warning here, to avoid people using this "for Java compatibility / quick/easy copy & paste porting of Java code"-only syntax when writing actual Groovy code (surprisingly not all developers read the complete documentation of a language, before they start using it, especially for something as base line as literal array syntax :-) ).

With regards to Jochen's critique of warnings in general: I absolutely agree that too many / too picky warnings are bad. But obviously we cannot use an error here instead, so if we want to keep this syntax in the corner it belongs, warning about its use looks like the only option that would consistently work in practice to me...
(same as potentially for Java lambda syntax, depending on whether one will be able to use 100% equivalent & concise Groovy closure syntax here instead).

Cheers,
mg


-------- Ursprüngliche Nachricht --------
Von: "Daniel.Sun" <[hidden email]>
Datum: 04.05.18 03:38 (GMT+01:00)
Betreff: [VOTE] Support Java-like array

Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html





--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

MG
Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

MG


On 07.05.2018 22:03, Guillaume Laforge wrote:
> I haven't voted as I'm not a big fan of adding this syntax construct.
>
> My feeling is that we shouldn't necessarily try to become a pure
> Java-superset, and it shouldn't be a goal to try more and more to
> close that gap.

Being able to write Java constructs in Groovy and incorporating the
improvements Groovy has to offer one after another was a major factor
for me, and it continues to be very helpful when introducing new
colleaugues to Groovy. If they know Java (and who does not, nowadays ?),
you can tell them: Just use what you know and - oh yea, do a search and
replace and remove all the semicolons at the end of each line, and you
can use a multiline String with embedded variables here, you might wanna
use a list literal there - and just say file.text = list.join('\n') to
write the result to a file, ...

> There are some confusing cases where (single element) array
> initializers can be confounded with closures.
>
> Also, I tend to prefer square brackets over curlies, but that's
> certainly a question of taste.

Agree with both points. I still think the plus outhweighs the minus -
see above and below.

>
> The other thing that slightly annoys me is that we're adding
> additional syntax for the same thing: array initializers, but look at
> how we added lambda notation.
> How will we explain users why we have two syntaxes for the same thing?
> Or when/why they should use one over the other?

Hence my suggestion to issue a "non-canonical Groovy / Java construct"-
warning in these cases - which everyone seems to confuse with some sort
of coding style warning, which to me it is clearly not: One just has to
ask oneself, whether anyone would have even considered voting for "...a
brand new alias for def: var !", or "...a way to write array literals,
so the look like closures: The amazing curly braces array literals
!".... (spoken with the voice of the boss from "IT Crowd", season 1 ;-) ).

(I understand that we currently don't have warnings in Groovy, but
seriously, how hard can it be to add errors which do not make the build
fail ?-)  )

Cheers,
mg





Reply | Threaded
Open this post in threaded view
|

Re: [VOTE] Support Java-like array

jwagenleitner
In reply to this post by paulk_asert
+1

Originally was going to vote 0, but had more time to devote to looking over the proposed PR/provisos and to consider the possible downsides.

On Mon, May 7, 2018 at 12:21 PM, Paul King <[hidden email]> wrote:
I would like to see some more PMC votes for this proposal.

On the one hand we don't like changes that aren't vetted enough, yet here is a proposed change that:
* is fairly comprehensive (just lacking some doco which I have already identified)
* closes some gaps in one of Groovy's design goals of making it easy to bring Java code to Groovy
* has sought feedback from dev and user communities (and seems to have strong support from our user base)

And yet, I am the only one from the PMC who has voted. I don't really care if the votes
are critical and provide a good reason but at least then it shows respect for the time and
energy put in to preparing a considered proposal and requesting formal feedback.
I know everyone is super busy but we just aren't a big enough PMC right now for
everyone to sit on the fence for proposals like this.

While I don't think we need to mirror everything in Java and I don't personally think I will
use this feature often in my own code, I can certainly see how new users to Groovy would
find it useful and so it seems like an overall win from my point of view. Zero-learning curve
from Java is one of the attractions of Groovy when marketing the language. This seems to
offer a bit of an improvement in that space with low investment and low risk.

If others can see serious flaws though, it would be good to provide the feedback so Daniel
can make some progress. Or if someone can see better bang-for-buck changes that we
should be making from a marketing of the language perspective, it would be good to pass
those insights on so Daniel and other contributors can make best use of their time.


Cheers, Paul.


On Fri, May 4, 2018 at 11:31 PM, Paul King <[hidden email]> wrote:
I would keep discussions about warnings in a separate thread so as not to derail the main topic here. If they were already widely used, it would be fine to indicate that we should just add another one. But that isn't the case and we'd need many discussions to do the topic justice.

Cheers, Paul.

On Fri, May 4, 2018 at 11:04 PM, mg <[hidden email]> wrote:
+1 with all that Paul says. Plus, we should support emitting a "Java compatibility / non-idiomatic-Groovy" warning here, to avoid people using this "for Java compatibility / quick/easy copy & paste porting of Java code"-only syntax when writing actual Groovy code (surprisingly not all developers read the complete documentation of a language, before they start using it, especially for something as base line as literal array syntax :-) ).

With regards to Jochen's critique of warnings in general: I absolutely agree that too many / too picky warnings are bad. But obviously we cannot use an error here instead, so if we want to keep this syntax in the corner it belongs, warning about its use looks like the only option that would consistently work in practice to me...
(same as potentially for Java lambda syntax, depending on whether one will be able to use 100% equivalent & concise Groovy closure syntax here instead).

Cheers,
mg


-------- Ursprüngliche Nachricht --------
Von: "Daniel.Sun" <[hidden email]>
Datum: 04.05.18 03:38 (GMT+01:00)
Betreff: [VOTE] Support Java-like array

Dear development community,

     In order to improve Groovy's compatibility with Java(Copy & Paste) and
make Groovy more friendly to Java developers[1], I propose to support
Java-like array[2][3] and start the VOTE thread for supporting Java-like
array.

     Please vote on supporting Java-like array since Apache Groovy 3.0.0.

     Here are the poll results from twitter and user mailing list for your
reference:

Sum up the poll results
24 votes in total(including my +1)
15 +1 (62.5%)
9     0 (37.5%)
0    -1 (  0.0%)

Twitter[4]
19 votes in total(not including my +1)
58% +1,
42%   0,
0%   -1

User mailing list(
http://groovy.329449.n5.nabble.com/Poll-About-supporting-Java-like-array-tt5749923.html
)
4 votes in total(not including my +1)
3  +1,
1    0,
0   -1

The vote is open for the next 72 hours and passes if a majority of at least
three +1 PMC votes are cast.

[ ] +1 Support Java-like array
[ ]  0 I don't have a strong opinion about this, but I assume it's ok
[ ] -1 Do not support Java-like array because...

Here is my vote:

+1

Cheers,
Daniel.Sun
[1] http://groovy-lang.org/differences.html
[2] https://github.com/apache/groovy/pull/691
[3] https://issues.apache.org/jira/browse/GROOVY-8561
[4] https://twitter.com/daniel_sun/status/990544485196091395





--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html



123