3 ms·
The feature discussed in the section entitled "Operator Overloading" is analogous to uniform function call syntax in Nim and D. It was something that at first I
by eindiran 8y ago
The feature discussed in the section entitled "Operator Overloading" is analogous to uniform function call syntax in Nim and D. It was something that at first I thought added unnecessary complexity to reading the code, but I slowly came around to it. Now I actually think that (once you know that it can be done) it makes code easier to read, in that you can choose to use the method-like syntax or the standard syntax depending on the particular situation.
I've written a fair amount of Groovy, but it's mostly been simple stuff integrating with Gradle or Jenkins. Maybe I should give it a try on a more significant project. There are a few features that make it quite interesting and some ideas that I think other languages could learn from (the one that leapt to mind is the Elvis operator for a special case of null-coalescing).