Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided i...
For further actions, you may consider blocking this person and/or reporting abuse
For new programmers, I'd focus on Kotlin and then maybe Scala and ignore Groovy. The reason is that Kotlin is gaining a lot of momentum in the backend world where Scala has maybe ran out of steam a little. E.g. the Spring project recommends it, and it is also the language of choice for Android. A couple of things that make this language stand out: 1) co-routines and Flow are a nice step forward for asynchronous and reactive programming. 2) kotlin native and kotlin-js mean that Kotlin is becoming a full stack language that you could use outside the JVM.
Scala is very different from Java/Kotlin/Groovy in the sense that it seems more focused on functional programming. It depends on your domain. If you are doing a lot of data processing with e.g. Spark, Scala may be the better fit. You might want to look at Clojure for the same reasons. It's worth noting that people in the Scala community seem worried about core committers jumping on the Kotlin bandwagon: reddit.com/r/scala/comments/8xreuv...
At this point, Kotlin is a natural successor to Groovy that removes most of the need for both Groovy and Java. It has most of the nice language features but without the complexity of being a dynamic scripting language. I know quite a few people that are switching from Groovy to Kotlin at this point. I see very little reason for anyone to pick Groovy for a project.
Great comment and advice but I think for a new programmer it's to start with Java or Python. I have also blogged about it java67.com/2018/07/is-java-best-pr...
I'd argue most Java programmers need to consider if they want to stick to Java when Kotlin is pretty much a drop in replacement that people are literally dropping in Java projects to replace it. I've done a few of those and the language is designed from the ground up to facilitate that and be better than Java at literally everything it does. It's a better Java in every way that counts.
It depends, learning Kotlin is definitely a good option but you won't always get a chance to replace existing Java project with kotlin, not at least on big Investment banks and Insurance firms where most of the Java run nowadays. I would stick to Java and just add Kotlin in my arsenal rather than making it my primary skill, but again that's my thought.
My thought as well...
Sure, those kind of environments are a bit slower to adjust. Unless you want to work in such an environment, you might want to look at what they will be doing in five years; which I'm betting will be mostly Kotlin because it is a drop in replacement on all of their Java stuff now already.
Short term having a Java background will help you understand Kotlin. But I have a suspicion that the JVM as a runtime will become less important as the native compiler and cross platform libraries mature.
Awesome article! I'm an Android developer that has fully shifted from Java to Kotlin for Android development and I love it! I also do a lot of automation/build stuff in Groovy because Gradle. If I was a Java dev moving to Android I would first try to understand basic Gradle syntax in Groovy then quickly move to Kotlin.
I am learning kotlin (also an android developer) any tips?
I was lucky that I started learning Kotlin with a few other developers while we all worked on one large legacy codebase. That gave me the advantage of learning from not only my mistakes, but the mistakes of my peers as we learned how to capitalize on Kotlin.
There are tons of resources for learning Kotlin as a beginner that a quick google will reveal, so I'll stick to some high level stuff that helped me.
Build off what you know. For me, this meant building things on Android because I leaned on my knowledge of the Android APIs to put Kotlin in context. For example, I used to use Interfaces to create callbacks from my
RecyclerViewadapters back to my Fragments. In Kotlin, I can just pass a lambda argument into my adapter instead. Then it's just applying the syntax and profiting from a big reduction in boiler plate. (I know lambda's aren't Kotlin exclusive, just an example I experienced moving from Java 7).I would also try to avoid using the Android Studio tool for Kotlin conversion. It does very little to help you understand how Kotlin works or even how you'd normally apply it. However, manual conversions did help me, especially when I challenged myself to use Kotlin language features and eliminate as much Java boiler plate as possible.
Finally, just explore the power of the tools in your code. Moving from Java to Kotlin introduces the concept of null-safety in a really full-featured way. This was novel at first, but when you start using tools like
let,runandwhento their full potential in concert with nullable types, you unlock some extremely cool stuff. It makes it hard to go back!Thanks for asking, and good luck!
Thanks!
I have tried all 3 languages over the last 3 years. I settled on Kotlin in the end to port a key product codebase at work too. For such a new language the tooling is incredibly mature, if you use IntelliJ. It took Scala nearly a decade to get the same level of integration. It's turned out be a great choice. Productivity is definitely up since the switch away from Java.
Groovy is nice, but it feels like an evolution of Java rather than something really new.
Scala is full of neat ideas, but it's also overly complex. There's often several ways to achieve the same thing. So no two devs implement something the same way. It seems to attract the sort of developers that reval in complexity purely for complexities sake. Even the compile times are noticeibly longer.
Kotlin has clearly stolen a lot of Scala's best bits. But it's skipped a lot of the complexixty. Plus it's integration with Java is much tighter than Scala. Our app ships over 150 jars with it. The majority are java libs. Using Kotlin instead of Java has never been an issue with any of them.
I would definitely say look at Kotlin for backend work. It's far more than just what people write Android Apps in these days!
"Scala is full of neat ideas, but it's also overly complex.": It makes me both excited and worried.
Hope the language would be refined a bit before I starting to get my feet wet.
I won't say complex but yes, the initial learning curve is a bit high.
OK, Thanks for the warning. Good to be aware. Let me see what I can do.
haha ha, don't worry, I didn't intend to scare you. Scala is a great language to master but yes you need initial zeal or at least a project. I learned while I had to work on a Scala project and I learned in just less than 4 weeks but yes I haven't mastered it yet.
Sure thing. haven't scared. Just good to know ahead, and I HAVE to learn it no matter what anyway. Thanks for kind words!
Tasted a very little bit of Kotlin and Groovy when learning Android dev.
Kotlin seems like a really fascinating language. imo, my impression was that the Kotlin is made by somebody who loves UML. Was very interesting, but Mobile dev. was really not my thing, so stopped there.
Have been willing to learn Scala for Big data. Have been on my to-do list for months.
Love the functional programming futures of other languages, so excited to try it out more.
Thank you for the amazing article with rich resources, as always!
Yes, one of the reasons a couple of my friend learned Scala is for Big Data and Spark, but you are right, it's the right mix of OOP and functional programming which is Scala's USP.
Your posts always make me ambivalent.
Those justify my to-do list, and make me nervous that I can't try them out right away. 😳
To be honest, you are not alone. Actually, I have been learning so many technologies now that I have to push many things to next year but yes it always depends how deep you want to go. I follow jack of all and master of one principle :-) and Java is my master :-)
What a shameless cash grab.. this article is literally full of affiliate links