6 ms·
I've honestly never heard anyone say that. Since Spring 5 it's pretty clear there's some interest in server-side Kotlin; there are several heavy-weights behind
by hocuspocus 6y ago
I've honestly never heard anyone say that. Since Spring 5 it's pretty clear there's some interest in server-side Kotlin; there are several heavy-weights behind that.
However, it's fair to make a distinction between the slowly evolving Android runtime and the JVM. Java language features are catching up with Kotlin, and might even surpass it (I believe pattern matching might land in Java sooner than in Kotlin). Also Kotlin might get stuck for a while when big breaking changes finally come to Java (like Valhalla). I understand why some companies/teams think it's not worth it.
- asdfthvaa2 6y ago>I believe pattern matching might land in Java sooner than in Kotlin Depends on what you call pattern matching. Kotlin had pattern matching from day one, but it's just one level, Java might have it recursive by java 19
- hocuspocus 6y agoCalling Kotlin's when pattern matching is a stretch. Even the official documentation doesn't call it like that anywhere.
- asdfthvaa2 6y agoWell, fr sealed classes it's quite good, but yeah, nothing like the scalas and haskells of this life
- matsemann 6y agoStill lots of kotlin-features I don't see land in java soon. My favorite is passing a lambda in brackets when it's the last argument to a function. Makes it easy to make semi-dsls and nice-looking code. So instead of myFun(someVar, { it.something() }) it can be written like myFun(someVar) { it.something() } or if no parameters to the function other than the lambda like myFun { it.something() } making the function almost look and behave like a language keyword. I also use extension-functions a lot. Especially for libraries or legacy-java code we wont touch. Where I work we now use Kotlin for all new backend code. And we don't do any Android.
- agumonkey 6y agois that modeled on ruby ?
- vvillena 6y agoThis is a very common idiom in Scala. Function definition is slightly different, but usage is the same.
- agumonkey 6y agoAny example ? or an idiom name I can google ?
- swsieber 6y agoGroovy also does it. I have no idea what the name is though: https://mrhaki.blogspot.com/2009/11/groovy-goodness-passing-closures-to.html?m=1 https://mrhaki.blogspot.com/2009/11/groovy-goodness-passing-...
- jayrhynas 6y agoSwift calls it trailing closure syntax
- agumonkey 6y agoOk so it's an explicit parameter, the function is just ~curried so you can just write it nicely.
- matsemann 6y agoNot sure about the exact name. But kotlin also has "function with receiver" that together with this makes it very easy to write almost a custom domain language on top of kotlin.
- matsemann 6y ago
- pjmlp 6y agoSpring sells to everyone, I am old enough to have seen that playbook with Groovy as main actor.
- BossingAround 6y agoGroovy was good in what it set out to do, i.e. bringing Python freshness into the vast Java ecosystem. I loved Grape for single-file scripts. Does any language have similar single-file dependency manager? I guess Go, but then, you have to compile Go, so it might not be as useful, because you distribute binaries anyways.
- hocuspocus 6y agoScala does, thanks to Ammonite: https://ammonite.io/#import$ivy https://ammonite.io/#import$ivy