I do not remember anyone ever listing some negative side effects - very
interested to learn about this, since up to now it was only ever "Groovy
already has support for that through @Newify" (which I evidently do not
agree with :-) ).
Apart from that: Much of the Groovy goodness comes from its syntax,
which also consists of allowing to leave unecessary things away.
Otherwise it could still require a semicolon at the end of each line, or
require brackets around arguments, or to supply last-parameter-closure
arguments to be given inside method argument brackets, or not allow
closures without an explicit empty parameter list, or not support "it"
as single closure argument name, etc etc.
So right now I do not understand that argument at all, but maybe the
negative side effects you mentioned will make this clear :-)
(The "new" operator in Java (and consecutively Groovy) is an artifact
coming from C++, where stack based alloaction uses the ctor call alone,
and the new keyword before the ctor call result in heap allocation -
which is of course the only allocation variety supported in Java/Groovy,
so no need to discern between the two cases exist...)
Cheers,
mg
On 16.02.2018 01:55, Jochen Theodorou wrote:
On 15.02.2018 06:04, MG wrote:
One other thing from the no-brainers section that Kotlin does better
than Groovy: Ctors can be called without the new keyword.
(Groovy's offer in this regard is alas severly lacking, hence nobody
uses it...)
I know this from Scala, how is the usage of this in Kotlin? Just to
not to have to write "new" is not enough of an advantage for me to
implement this and get all the negative side effects. There must be
more to the usage than just that. And I assume there is in Kotlin,
which I do not know about
bye Jochen