Re:The Groovy project is looking for a new home
by sytse on Monday January 19, 2015 @09:46PM
(#8915209)
Isn't the elvis operator || in ruby?
see http://stackoverflow.com/a/7816041/613240
Re:The Groovy project is looking for a new home
by bjfish on Tuesday January 20, 2015 @08:53AM
(#8916896)
Yes, but I think that syntax is a little ugly, see https://news.ycombinator.com/item?id=8916893
Re:The Groovy project is looking for a new home
by _pmf_ on Wednesday January 21, 2015 @01:36AM
(#8921839)
> but I'd also like to see blocks in Groovy
Groovy allows passing a closure to a method with signature (where p3 is a callable)
a(p1, p2, p3)
as a(some_val, some_val){ closure content }
Are Ruby's blocks more powerful?
Couple things to add to the pros/cons:
> Developer friendly (Ruby has a number of syntax warts, e.g. elvis operator, null safe operator - just to start) syntax
I would love to see the elvis operator and the null safe operator in Ruby, but I'd also like to see blocks in Groovy.
An addition to the pros of Groovy:
Interacts extremely well with existing Java code. While you can call into Java from JRuby, it's no where near as clean to interoperate with Java in the same code base. In the past I've loved Groovy because I could use it very cleanly inside a codebase that had a lot of Java, e.g. use Groovy to write controllers or data munging code but use Java for most other things.