Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Valentin Deleplace
Announcement: it is now possible to write Groovy contents in
Programming-Idioms :)

The editing form looks like this:
[image: image.png]
- the yellow parts are mandatory
- the green parts are what makes a great implementation, and it does take
more effort to write. The demo can be e.g. a link to runnable code in
the Groovy
web console .
- if the code was copied from another source, please do paste the source
URL in "Original attribution". The source needs to be compatible with
CC-BY-SA .
- the Imports box is needed for any import that is not implicit. Write the
full lines, not just the package names. If there are several ways
 to import, then choose
the one you feel more idiomatic.
- if you wrote the contribution yourself, then it becomes CC-BY-SA and
other folks on the internet can reuse your contribution for their own
projects.

Thanks again for this warm welcome in the Groovy community :)

Valentin
Twitter : @val_deleplace


On Fri, 9 Oct 2020 at 14:38, Valentin Deleplace 
wrote:

> Awesome, thank you Søren and Paul.
> I'll provide the details after I've deployed with Groovy in the list.
>
> Is there a preferred website where it's possible to run arbitrary Groovy
> code, used by the community? I'm thinking of something like the go
>  playground . Links
> to such runnable demos are very valuable in Programming-Idioms.
> Cheers
>
> Valentin
> Happy path engineer
> Google Cloud Platform
> Twitter : @val_deleplace
>
>
> On Fri, 9 Oct 2020 at 13:31, Paul King  wrote:
>
>> +1
>>
>> On Fri, Oct 9, 2020 at 9:22 PM Søren Berg Glasius 
>> wrote:
>>
>>> Hi Valentin,
>>>
>>> I think it sounds like a great idea, and I would like to participate and
>>> contribute to small snippets. I am a seasoned Groovy developer (I think)
>>> and the co-founder* of GR8Conf, the "All Things Groovy" conference.
>>>
>>> Let me know how to proceed.
>>>
>>> * Other founder is in fact Guillaume Laforge :-)
>>>
>>> Best regards / Med venlig hilsen,
>>> Søren Berg Glasius
>>>
>>> Hedevej 1, Gl. Rye, 8680 Ry, Denmark
>>> Mobile: +45 40 44 91 88 <+45%2040%2044%2091%2088>, Skype: sbglasius
>>> --- Press ESC once to quit - twice to save the changes.
>>>
>>>
>>> Den fre. 9. okt. 2020 kl. 12.07 skrev Valentin Deleplace <
>>> delepl...@google.com>:
>>>
 Hello folks
 I admin https://programming-idioms.org/about and I'd like to add
 Groovy to the list of available languages. The website is a collection of
 "how to do X in language Y".
 My friend Guillaume Laforge advised me to ask this mailing list for
 help! The goal is to encourage contribution of quality contents so it can
 actually be helpful to a beginner or seasoned groovyist visitor.

 A quality contribution is a snippet that is correct, concise, having an
 explanation, a link to the official docs, and ideally a link to an online
 demo. For example at
 https://programming-idioms.org/idiom/96/check-string-prefix some
 implementations are high-quality, but not all of them.

 Writing a correct snippet takes about 3mn, while writing a high-quality
 contribution easily takes over 15mn.
 Before I open the gates by adding Groovy in the system, I'd like to
 know if some of you would be willing to contribute and curate some 
 contents?

 Thank you in advance
 Valentin


 Valentin
 Happy path engineer
 Google Cloud Platform
 Twitter : @val_deleplace

>>>


Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Valentin Deleplace
Hi MG, thank you so much for this thorough feedback, this is extremely
valuable.
I'll answer your suggestions, keeping in mind that I have to deal with
conflicting concerns and the end result will not be perfect in every aspect:

0. "Groovy"+"Groovy (Static)": though this would be the "exact thing" to
do, I hope that most of the language is the same in the two cases.  If
something works only in one of the two, please mention it in the comment
box on the right. Ideally, add a new separate implementation+comment box to
achieve the same goal in the other case.

a1. Amazing! Looking forward to the good stuff ahead.

a2. Thanks for the link, I didn't know it yet.

b1. It is by design that several implementations for the same language are
accepted, and 2 or more can be regarded as idiomatic. The quality of the
contents is uneven, sometimes a contribution is clearly inferior. This is a
problem that we should ideally address by curating, provided we have the
proper skills, and time to invest.

b2. A voting system is implemented but disabled for now. It is at odds with
the current design in which you don't need to authenticate with an account.
This favors immediate frictionless contribution which is cool, but also
means there is no effective way to tell apart legit votes from abusive
votes. The current tradeoff is to not open the pandora box of votes, and
instead let any user "flag" the content if they consider it problematic for
any reason. A snippet being mediocre is a valid reason for a user to flag
the snippet.

b3. Fair enough! Let's track this in issue #128


b4. There is no categorization for now. You may open an issue if you feel
it's missing. The current design favors the "search by keywords"
navigation, and the "related idioms" link in the right bar. Also, each
idiom has a list of "keywords" that make it more surfaceable by text
search. I suspect that adding tags or categories would be redundant, though
I can also understand that grouping is desirable.

b6. Indeed a side-by-side cheatsheet would be cool, please add your vote to
the existing issue #101


7. Yes all implementations have their own ID and a canonical URL, e.g. impl
1449 .
The language list in the top box of an idiom (on the right of the idiom
title) contains all its specific implementation links.

Valentin
Happy path engineer
Google Cloud Platform
Twitter : @val_deleplace


On Fri, 9 Oct 2020 at 18:07, MG  wrote:

> Hi Valentin,
>
> with Groovy maybe one should consider doing a "Groovy" and "Groovy
> (Static)", since not all dynamic solutions a valid for the @CompilStatic
> case ?
>
> Additional points:
>
>1. I might contribute, as time allows.
>2. Havig said that: Just go to
>https://mrhaki.blogspot.com/search/label/Groovy, copy & link back to
>Mr. Hubert A. Klein Ikkink's site and you should be all set ;-)
>3. I had to laugh so hard when I saw the Cobol version of what is
>"s.startsWith(prefix)" in pretty much any other language - thank god I am
>young enough to have missed that :-)
>
> Some general site feedback:
>
>1. I found it confusing that there can be more than one tab per
>language (e.g. for C++), especially if one idiom is clearly inferior to the
>other
>2. If multiple versions were allowed, a voting system might be the way
>to go - or someone curating each language...
>3. I would have expected the landing page to not only display a search
>box, but also an (categorized) idiom list. I know the current web design
>meta is "as simple/barren as humanly possible", but the small link icon at
>the bottom that leads to a menu, where you can then get this infromation
>under "All idioms" or "Language coverage"  is easy to miss.
>4. Speaking of "categorized idiom list": To be able to quickly filter
>after idioms relating to e.g. "threads" or "strings" would imho generally
>be helpful
>5. On the other hand like the cheat sheet feature (though I find the
>name misleading), since oftentimes being able to just search/browse in a
>complete result set in the browser can imho be a good way to find what you
>are looking for (and maybe discover something you were not looking for*) 
> :-)
>6. Being able to have two languages displayed side by side in the
>"cheat sheet" view would be great for comparing languages
>
> Cheers,
> mg
> *In the category of "So close, but not Groovy" I stumbled upon the fact
> that it seems Kotlin still does not have a list/map literal syntax:
> https://programming-idioms.org/idiom/8/initialize-a-new-map-associative-array
> **; the Java-like solution looks to be the best of the 3 solutions offered,
> but it comes with a "use only if performance isn't critical" caveat...
> (see also https://github.com/Kotlin/KEEP/pull/112 ;
> https:

Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread MG

Hi Valentin,

    with Groovy maybe one should consider doing a "Groovy" and "Groovy 
(Static)", since not all dynamic solutions a valid for the @CompilStatic 
case ?


Additional points:

1. I might contribute, as time allows.
2. Havig said that: Just go to
   https://mrhaki.blogspot.com/search/label/Groovy, copy & link back to
   Mr. Hubert A. Klein Ikkink's site and you should be all set ;-)
3. I had to laugh so hard when I saw the Cobol version of what is
   "s.startsWith(prefix)" in pretty much any other language - thank god
   I am young enough to have missed that :-)

Some general site feedback:

1. I found it confusing that there can be more than one tab per
   language (e.g. for C++), especially if one idiom is clearly inferior
   to the other
2. If multiple versions were allowed, a voting system might be the way
   to go - or someone curating each language...
3. I would have expected the landing page to not only display a search
   box, but also an (categorized) idiom list. I know the current web
   design meta is "as simple/barren as humanly possible", but the small
   link icon at the bottom that leads to a menu, where you can then get
   this infromation under "All idioms" or "Language coverage"  is easy
   to miss.
4. Speaking of "categorized idiom list": To be able to quickly filter
   after idioms relating to e.g. "threads" or "strings" would imho
   generally be helpful
5. On the other hand like the cheat sheet feature (though I find the
   name misleading), since oftentimes being able to just search/browse
   in a complete result set in the browser can imho be a good way to
   find what you are looking for (and maybe discover something you were
   not looking for*) :-)
6. Being able to have two languages displayed side by side in the
   "cheat sheet" view would be great for comparing languages

Cheers,
mg

*In the category of "So close, but not Groovy" I stumbled upon the fact 
that it seems Kotlin still does not have a list/map literal syntax: 
https://programming-idioms.org/idiom/8/initialize-a-new-map-associative-array 
**; the Java-like solution looks to be the best of the 3 solutions 
offered, but it comes with a "use only if performance isn't critical" 
caveat...
(see also https://github.com/Kotlin/KEEP/pull/112 ; 
https://kotlinlang.org/docs/reference/constructing-collections.html)


**Is it possible to link directly to a specific language version of an 
idiom ?



On 09/10/2020 12:06, Valentin Deleplace wrote:

Hello folks
I admin https://programming-idioms.org/about and I'd like to add 
Groovy to the list of available languages. The website is a collection 
of "how to do X in language Y".
My friend Guillaume Laforge advised me to ask this mailing list for 
help! The goal is to encourage contribution of quality contents so it 
can actually be helpful to a beginner or seasoned groovyist visitor.


A quality contribution is a snippet that is correct, concise, having 
an explanation, a link to the official docs, and ideally a link to an 
online demo. For example at 
https://programming-idioms.org/idiom/96/check-string-prefix some 
implementations are high-quality, but not all of them.


Writing a correct snippet takes about 3mn, while writing a 
high-quality contribution easily takes over 15mn.
Before I open the gates by adding Groovy in the system, I'd like to 
know if some of you would be willing to contribute and curate some 
contents?


Thank you in advance
Valentin


Valentin
Happy path engineer
Google Cloud Platform
Twitter : @val_deleplace




Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Guillaume Laforge
You can use the Groovy Web Console:
http://groovyconsole.appspot.com/

On Fri, Oct 9, 2020 at 2:38 PM Valentin Deleplace 
wrote:

> Awesome, thank you Søren and Paul.
> I'll provide the details after I've deployed with Groovy in the list.
>
> Is there a preferred website where it's possible to run arbitrary Groovy
> code, used by the community? I'm thinking of something like the go
>  playground . Links
> to such runnable demos are very valuable in Programming-Idioms.
> Cheers
>
> Valentin
> Happy path engineer
> Google Cloud Platform
> Twitter : @val_deleplace
>
>
> On Fri, 9 Oct 2020 at 13:31, Paul King  wrote:
>
>> +1
>>
>> On Fri, Oct 9, 2020 at 9:22 PM Søren Berg Glasius 
>> wrote:
>>
>>> Hi Valentin,
>>>
>>> I think it sounds like a great idea, and I would like to participate and
>>> contribute to small snippets. I am a seasoned Groovy developer (I think)
>>> and the co-founder* of GR8Conf, the "All Things Groovy" conference.
>>>
>>> Let me know how to proceed.
>>>
>>> * Other founder is in fact Guillaume Laforge :-)
>>>
>>> Best regards / Med venlig hilsen,
>>> Søren Berg Glasius
>>>
>>> Hedevej 1, Gl. Rye, 8680 Ry, Denmark
>>> Mobile: +45 40 44 91 88 <+45%2040%2044%2091%2088>, Skype: sbglasius
>>> --- Press ESC once to quit - twice to save the changes.
>>>
>>>
>>> Den fre. 9. okt. 2020 kl. 12.07 skrev Valentin Deleplace <
>>> delepl...@google.com>:
>>>
 Hello folks
 I admin https://programming-idioms.org/about and I'd like to add
 Groovy to the list of available languages. The website is a collection of
 "how to do X in language Y".
 My friend Guillaume Laforge advised me to ask this mailing list for
 help! The goal is to encourage contribution of quality contents so it can
 actually be helpful to a beginner or seasoned groovyist visitor.

 A quality contribution is a snippet that is correct, concise, having an
 explanation, a link to the official docs, and ideally a link to an online
 demo. For example at
 https://programming-idioms.org/idiom/96/check-string-prefix some
 implementations are high-quality, but not all of them.

 Writing a correct snippet takes about 3mn, while writing a high-quality
 contribution easily takes over 15mn.
 Before I open the gates by adding Groovy in the system, I'd like to
 know if some of you would be willing to contribute and curate some 
 contents?

 Thank you in advance
 Valentin


 Valentin
 Happy path engineer
 Google Cloud Platform
 Twitter : @val_deleplace

>>>

-- 
Guillaume Laforge
Apache Groovy committer
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Twitter: @glaforge 


Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Valentin Deleplace
Awesome, thank you Søren and Paul.
I'll provide the details after I've deployed with Groovy in the list.

Is there a preferred website where it's possible to run arbitrary Groovy
code, used by the community? I'm thinking of something like the go
 playground . Links to
such runnable demos are very valuable in Programming-Idioms.
Cheers

Valentin
Happy path engineer
Google Cloud Platform
Twitter : @val_deleplace


On Fri, 9 Oct 2020 at 13:31, Paul King  wrote:

> +1
>
> On Fri, Oct 9, 2020 at 9:22 PM Søren Berg Glasius 
> wrote:
>
>> Hi Valentin,
>>
>> I think it sounds like a great idea, and I would like to participate and
>> contribute to small snippets. I am a seasoned Groovy developer (I think)
>> and the co-founder* of GR8Conf, the "All Things Groovy" conference.
>>
>> Let me know how to proceed.
>>
>> * Other founder is in fact Guillaume Laforge :-)
>>
>> Best regards / Med venlig hilsen,
>> Søren Berg Glasius
>>
>> Hedevej 1, Gl. Rye, 8680 Ry, Denmark
>> Mobile: +45 40 44 91 88 <+45%2040%2044%2091%2088>, Skype: sbglasius
>> --- Press ESC once to quit - twice to save the changes.
>>
>>
>> Den fre. 9. okt. 2020 kl. 12.07 skrev Valentin Deleplace <
>> delepl...@google.com>:
>>
>>> Hello folks
>>> I admin https://programming-idioms.org/about and I'd like to add Groovy
>>> to the list of available languages. The website is a collection of "how to
>>> do X in language Y".
>>> My friend Guillaume Laforge advised me to ask this mailing list for
>>> help! The goal is to encourage contribution of quality contents so it can
>>> actually be helpful to a beginner or seasoned groovyist visitor.
>>>
>>> A quality contribution is a snippet that is correct, concise, having an
>>> explanation, a link to the official docs, and ideally a link to an online
>>> demo. For example at
>>> https://programming-idioms.org/idiom/96/check-string-prefix some
>>> implementations are high-quality, but not all of them.
>>>
>>> Writing a correct snippet takes about 3mn, while writing a high-quality
>>> contribution easily takes over 15mn.
>>> Before I open the gates by adding Groovy in the system, I'd like to know
>>> if some of you would be willing to contribute and curate some contents?
>>>
>>> Thank you in advance
>>> Valentin
>>>
>>>
>>> Valentin
>>> Happy path engineer
>>> Google Cloud Platform
>>> Twitter : @val_deleplace
>>>
>>


Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Paul King
+1

On Fri, Oct 9, 2020 at 9:22 PM Søren Berg Glasius  wrote:

> Hi Valentin,
>
> I think it sounds like a great idea, and I would like to participate and
> contribute to small snippets. I am a seasoned Groovy developer (I think)
> and the co-founder* of GR8Conf, the "All Things Groovy" conference.
>
> Let me know how to proceed.
>
> * Other founder is in fact Guillaume Laforge :-)
>
> Best regards / Med venlig hilsen,
> Søren Berg Glasius
>
> Hedevej 1, Gl. Rye, 8680 Ry, Denmark
> Mobile: +45 40 44 91 88, Skype: sbglasius
> --- Press ESC once to quit - twice to save the changes.
>
>
> Den fre. 9. okt. 2020 kl. 12.07 skrev Valentin Deleplace <
> delepl...@google.com>:
>
>> Hello folks
>> I admin https://programming-idioms.org/about and I'd like to add Groovy
>> to the list of available languages. The website is a collection of "how to
>> do X in language Y".
>> My friend Guillaume Laforge advised me to ask this mailing list for help!
>> The goal is to encourage contribution of quality contents so it can
>> actually be helpful to a beginner or seasoned groovyist visitor.
>>
>> A quality contribution is a snippet that is correct, concise, having an
>> explanation, a link to the official docs, and ideally a link to an online
>> demo. For example at
>> https://programming-idioms.org/idiom/96/check-string-prefix some
>> implementations are high-quality, but not all of them.
>>
>> Writing a correct snippet takes about 3mn, while writing a high-quality
>> contribution easily takes over 15mn.
>> Before I open the gates by adding Groovy in the system, I'd like to know
>> if some of you would be willing to contribute and curate some contents?
>>
>> Thank you in advance
>> Valentin
>>
>>
>> Valentin
>> Happy path engineer
>> Google Cloud Platform
>> Twitter : @val_deleplace
>>
>


Re: Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Søren Berg Glasius
Hi Valentin,

I think it sounds like a great idea, and I would like to participate and
contribute to small snippets. I am a seasoned Groovy developer (I think)
and the co-founder* of GR8Conf, the "All Things Groovy" conference.

Let me know how to proceed.

* Other founder is in fact Guillaume Laforge :-)

Best regards / Med venlig hilsen,
Søren Berg Glasius

Hedevej 1, Gl. Rye, 8680 Ry, Denmark
Mobile: +45 40 44 91 88, Skype: sbglasius
--- Press ESC once to quit - twice to save the changes.


Den fre. 9. okt. 2020 kl. 12.07 skrev Valentin Deleplace <
delepl...@google.com>:

> Hello folks
> I admin https://programming-idioms.org/about and I'd like to add Groovy
> to the list of available languages. The website is a collection of "how to
> do X in language Y".
> My friend Guillaume Laforge advised me to ask this mailing list for help!
> The goal is to encourage contribution of quality contents so it can
> actually be helpful to a beginner or seasoned groovyist visitor.
>
> A quality contribution is a snippet that is correct, concise, having an
> explanation, a link to the official docs, and ideally a link to an online
> demo. For example at
> https://programming-idioms.org/idiom/96/check-string-prefix some
> implementations are high-quality, but not all of them.
>
> Writing a correct snippet takes about 3mn, while writing a high-quality
> contribution easily takes over 15mn.
> Before I open the gates by adding Groovy in the system, I'd like to know
> if some of you would be willing to contribute and curate some contents?
>
> Thank you in advance
> Valentin
>
>
> Valentin
> Happy path engineer
> Google Cloud Platform
> Twitter : @val_deleplace
>


Re: Fwd: Private/protected no-arg constructor with @MapConstructor/@Immutable?

2020-10-09 Thread Damir Murat
Thank you for your help. You are most kind, sir :-)

I ended up creating a helper AST transform. If you are interested, you can see 
it here:
https://github.com/croz-ltd/klokwrk-project/commit/6f297c96db900d8dabffb45f2a5a38c60e442418

To complete my @Immutable customization story, I also created an AST transform 
that
adds my common post-check in the generated map constructor. You can find it 
here:
https://github.com/croz-ltd/klokwrk-project/commit/724126dac172fecba74a913199ead87223eb4c69

Of course, any comments or suggestions are more than welcome :-)

Thank you,
Damir


Help with adding Groovy to Programming-Idioms

2020-10-09 Thread Valentin Deleplace
Hello folks
I admin https://programming-idioms.org/about and I'd like to add Groovy to
the list of available languages. The website is a collection of "how to do
X in language Y".
My friend Guillaume Laforge advised me to ask this mailing list for help!
The goal is to encourage contribution of quality contents so it can
actually be helpful to a beginner or seasoned groovyist visitor.

A quality contribution is a snippet that is correct, concise, having an
explanation, a link to the official docs, and ideally a link to an online
demo. For example at
https://programming-idioms.org/idiom/96/check-string-prefix some
implementations are high-quality, but not all of them.

Writing a correct snippet takes about 3mn, while writing a high-quality
contribution easily takes over 15mn.
Before I open the gates by adding Groovy in the system, I'd like to know if
some of you would be willing to contribute and curate some contents?

Thank you in advance
Valentin


Valentin
Happy path engineer
Google Cloud Platform
Twitter : @val_deleplace