4 ms·
Groovy, the real JavaScript. I love Spock but never could get into using Groovy for non-test code.
by linkmotif 8y ago
Groovy, the real JavaScript. I love Spock but never could get into using Groovy for non-test code.
- zmmmmm 8y agoYeah, you really need to adopt a completely different style if you're writing a whole applications with Groovy as opposed to scripting or test code. It's like a different language almost (more like nicer Java). It does work quite well for it when you do that though.
- linkmotif 8y agoI really like groovy with all its groovy idioms and its extended library. It’s really fun to Google for how to write something in Groovy you usually get something really ice. I just didn’t like the lack of typing for non test code. And spotty IDE support even in IntelliJ. It seems to be perfect for tests because your code still compiles and you can fix the tests when you’re ready. Also Spock is beautiful...
- nitrogen 8y agoYou might enjoy Kotlin.
- linkmotif 8y agoYeah I really want to move to a language with pattern matching. Hopefully it will finally land in Java
- vbezhenar 8y agoKotlin does not support pattern matching.
- sk5t 8y agoYeah, Kotlin has some "enhanced switch" type stuff, but nothing that compares to Scala's matching with unapply, list extraction, etc.
- linkmotif 8y agoOh! Thought it did. Forget Kotlin, then :)!!
- sk5t 8y agoKotlin is still a pleasant language to use, and some of the ideas have some good carryover to Scala, with quite a lot less culture shock than going right from Java to Scala.
- nostrademons 8y agoIt has destructuring in value binding and lambda parameters, as well. Pretty handy when you're dealing with a lot of pairs, triples, and data classes, though not quite as powerful as true pattern-matching.
- vbezhenar 8y agoActually they have some foundations, componentN functions serve similar role to unapply, so theoretically it should be possible to build good enough pattern matching. But, unfortunately, they seem to slow down language development a lot since release.
- dionian 8y agoscala, eta
- Floegipoky 8y agohttps://docs.scala-lang.org/tour/pattern-matching.html https://docs.scala-lang.org/tour/pattern-matching.html
- vorg 8y agoGood idea. I refer to Apache Groovy as "Bash for the JVM". The static typing features in Groovy were bolted on for version 2, whereas Scala and Kotlin were designed from the ground up for building actual systems on the JVM, so they're a far better choice for that.