7 ms·
I believe scope functions are a killer feature of the language. Being able to chain methods and write compact functions without having to declare variables, it
by listenallyall 6y ago
I believe scope functions are a killer feature of the language. Being able to chain methods and write compact functions without having to declare variables, it makes so much code act and feel functional and direct. Immutability isn't on your list, it also contributes to the functional feel of the codebase.
Definitely my favorite language currently, and extremely well-suited for server-side, it's certainly not just about Android.
- agumonkey 6y agoIt's impressive how many people are screaming "will never leave android" when discussing kotlin. Thanks for your input
- hocuspocus 6y agoI'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.
- 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
- pjmlp 6y agoBecause Android is Kotlin's selling platform, on the JVM it will be as relevant as Beanshell, jtcl, jython, clojure, scala, and many other guest languages. Guest languages relevance always fades away as the platform language improves and the FFI gets out of touch with that old version of the language. C18 on UNIX vs C++, JavaScript vs Typescript (see private members), and when time comes inline classes/reiffed generics/SIMD types vs being able to target both Android and JVM on Kotlin's case.
- The_Colonel 6y agoOld men are always trying to discount progress as reiteration of what they already saw to fail. But in reality, it's not the same thing, it's not the same time, not the same market environment. Kotlin can succeed where others failed before because just about everything about it is incomparable with sorts like Beanshell.
- dimitrios1 6y agoYoung men are always trying to count progress as the reiteration of what has already come before them. In reality, while the differences are minor, they are the same thing. Time fades away, and market dynamics operate the same as they did 10,20..100 years ago.
- The_Colonel 6y agoYes, that happens with young people as well. The hubris is in using absolute statements ("platform languages always win") instead of being a little bit more humble with their projections. Old men should know better that history rarely unfolds as expected.
- pjmlp 6y agoOld wise men know that young people forget history too soon, and we all know what happens when history gets forgotten.
- 6y ago
- thecupisblue 6y agoI'd even say well-suited for the web! KotlinJS feels so much more natural, safer and faster to write (in IntelliJ especially) than writing plain JS does.