4 ms·
> code that would be 5 to 10 times longer in Java I wonder if that's Java 8 with its lambdas? Most sites just use Apache Groovy for the scripty dynamically-typ
by vorg 10y ago
> code that would be 5 to 10 times longer in Java
I wonder if that's Java 8 with its lambdas? Most sites just use Apache Groovy for the scripty dynamically-typed stuff only (e.g. testing, build config, grails MOP) and leave the statically-typed stuff for Java or some other JVM language. Of course, those variables in global scope will still be a problem.
- SOLAR_FIELDS 10y agoI was speaking specifically to Java 7 but can offer the Java 8 perspective as well. Java 8 with lambdas makes it better - but you still have to bake your own on top of the system in a lot of cases. The real joy of Groovy is having the powerful manipulation functions just there for you without any external library. A good analogy would be anonymous functions in Vanilla JS being like Java 8 lambdas vs the expressive power the baked in goodness Lodash offers being like what Groovy closures supplement to the JVM environment. You don't always need it, but the general purpose tooling makes your life a lot easier in certain specific cases. With that being said in our use case Groovy was very pointed - serving a specific, directed purpose in a monitored environment. When developers were left to their own devices to design general scripting and tooling that they were comfortable with, nearly everyone chose Python and to a lesser extent Ruby. I think Groovy is great to create some JVM specific glue and support for an enterprise system - but as a general purpose language it still has a long way to go. As an example, try and make a tool in Groovy for interacting with a REST API and compare your effort for doing so to Python - One of these is significantly less painful than the other.