groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: About simplifying the switch for runtime groovydoc
Date Mon, 22 Oct 2018 08:36:07 GMT
Groovy always tried to strike a fine balance between conciseness and
readability.
If you look even at our operators, they try to convey some meaning, like ?.
is like let's try to get that field/method with the question mark, or ?:
being a contraction of the ternary operator.
But to avoid making code too cryptic, we've forbidden users to create their
own custom operators.
So let's be sure to keep the nice philosophy of the language when
discussing language changes.

I'm not fundamentally against it, but perhaps there are more readable
options.
I think @Groovydoc is rarely used (I've never seen it used in the wild or
anyone mentioning its usage or our mailing-list), so I'd tend to prefer to
see how much it's used before introducing a dedicated syntax.

Are there other notation ideas that would make the intent more explicit?
more obvious?

Guillaume


On Mon, Oct 22, 2018 at 5:00 AM Remko Popma <remko.popma@gmail.com> wrote:

> MG’s arguments make sense to me.
>
> Remko
>
> On Oct 21, 2018, at 23:05, MG <mgbiz@arscreat.com> wrote:
>
> Yea, sure. But doesn't a new shorthand syntax always have that trait ?-)
> And would that not mean that we can never, ever again introduce a
> shorthand notation in Groovy for anything, unless it is syntactically based
> on an existing/established shorthand notation (which in this case it kinda
> is, since it looks like a Javadoc comment - with something extra. Aka
> Groovy ;-) ) ?
>
> Learning a language always means learning its syntax. If you encounter
> something unexpected, Google is your friend (Not a Google expert, but I
> assume "/**@" should be good to find, since it contains no spaces).
> Also in this case I think it would not make a lot of difference to the
> casual user: He will most likely just assume it is some kind of Javadoc
> variety, if he even notices the "@" at the end.
>
> Instead of outright blocking another proposal by Daniel, maybe we can
> instead come up with a compromise that everyone can can agree on... ?-)
>
> Cheers,
> mg
>
>
> On 21.10.2018 10:51, Guillaume Laforge wrote:
>
> Well, /** has been in use for more than 20 years, so we've had time to get
> used to it.
> /**@ is totally non-obvious. I've no idea what it would have been about
> without having read this thread.
>
> On Sun, Oct 21, 2018 at 4:28 AM MG <mgbiz@arscreat.com> wrote:
>
>> I agree with Daniel, I think
>> /**@
>> would be neither more nor less cryptic than
>> /**
>> which everyone is just used to from Java (and which seems to have no
>> memnonic / self-explanatory characteristics to me...).
>>
>> Cheers,
>> mg
>>
>>
>> On 21.10.2018 03:04, Daniel.Sun wrote:
>> > Hi Guillaume,
>> >
>> >         Javadoc switch `/**` is cryptic too at the beginning, but now I
>> > believe few people like the following form ;-)
>> >
>> > /*
>> >    * @Javadoc
>> >    * some Javadoc here
>> >    */
>> >
>> > Cheers,
>> > Daniel.Sun
>> >
>> >
>> >
>> >
>> > -----
>> > Daniel Sun
>> > Apache Groovy committer
>> > Blog: http://blog.sunlan.me
>> > Twitter: @daniel_sun
>> >
>> > --
>> > 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
>
> Blog: http://glaforge.appspot.com/
> Twitter: @glaforge <http://twitter.com/glaforge>
>
>
>

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

Blog: http://glaforge.appspot.com/
Twitter: @glaforge <http://twitter.com/glaforge>

Mime
View raw message