Live data from Hacker News

The Groovy project is looking for a new home

glaforge.appspot.com

71–72 of 72 posts

Re: The Groovy project is looking for a new home

#71
post #35
post #12

I know and use both Ruby/Rails and Groovy/Grails and wanted to debunk a myth here: "Interest in Grails/Groovy is diminishing" - I won't comment on trends but there is still a large, active user base and community I won't list the benefits of Ruby/Rails over Groovy/Grails because I will assume the audience here is familiar with Ruby/Rails. Specifically here are some benefits of Groovy over Ruby: - Very good JVM toolin…

I've also used both languages a fair bit, but I've never used Grails (although I've played with it). 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: Intera…

> 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?

Re: The Groovy project is looking for a new home

#72

Earlier quoted context omitted.

I haven't used Groovy much, so I may be completely missing something here, but how is the elvis operator different from a simple guard in Ruby? Based on the docs for elvis, it looks like potentiallyFalsyValue ?: safeDefault is exactly equivalent to potentially_falsy_value || safe_default in Ruby Further, the null-safe operator seems to be the same as #try in Rails and overuse of either is probably a bit of a smell th…

It's subtle, but I think the difference is that in ruby when potentially_falsy_value is false you will get the safeDefault. But with ?: you would get the potentiallyFalsyValue as false. The only time you get safeDefault is when potentiallyFalsyValue is nil/null

The docs seem to state otherwise

   One instance of where this is handy is for 
   returning a 'sensible default' value if an 
   expression resolves to false or null
http://groovy.codehaus.org/Operators#Operators-ElvisOperator(?:)
Post reply on HN