6 ms·
Yep agree with all you said. Nowadays new job every year people at work are scaring me with their enthusiasm to replace decades old solid Java applications whic
by geodel 3y ago
Yep agree with all you said. Nowadays new job every year people at work are scaring me with their enthusiasm to replace decades old solid Java applications which are performant and working fine with Kotlin and what not.
- Alupis 3y agoI wouldn't advocate for replacing/re-writing old stuff - but you should try out Kotlin for backend work. It's amazing. Java programmers will have only a small learning curve before feeling productive, and can gradually get more comfortable with idomatic Kotlin as they progress through their journey. Kotlin, as a language, was very well through out, letting you use as much or as little of it as you are comfortable with.
- pjmlp 3y agoIt is still another syntax, with idioms moving away from JVM, their own little islands of Kontlin only libraries, and only works on InteliJ/Android Studio. I don't see any value in Kotlin outside Android shops.
- jcadam 3y ago> I don't see any value in Kotlin outside Android shops. Developer experience is important to some people - not just devs, but those who seek to recruit and retain good ones. Of course, if you're looking to hire massive numbers of butts-in-seats (gov work, large enterprise shops, etc) I suppose Java is probably the ideal choice.
- Alupis 3y agoWhile true it has it's own syntax, the syntax is better than Java and more ergonomic. With that said, you can write Java in Kotlin - and by that I mean Kotlin code that looks almost exactly like Java. Heck, you can have .java and .kt source within the same project all mixed together if you want. Kotlin libraries are interoperable with Java and vice versa. In some specific cases, a Kotlin library needs a little syntactic sugar to make it work with Java like a Java developer would expect, but it's easy to do. Going the other direction though - Java library used in Kotlin, zero issues, it just works. Some Java developers don't even realize they're already using Kotlin - take a look at OKHttp and friends... Lastly, there's Kotlin support is all major IDE's, including IntelliJ of course, but also Eclipse and likely whatever editor/ide you prefer. Kotlin is basically just a bunch of libs. I would argue Kotlin is better outside of Android than in Android. For backend work, particularly when coupled with Spring/Boot, it's freaking amazing. The Spring team has put in an impressive amount of work to make Kotlin a first-class language within the ecosystem, and it really shows.
- pjmlp 3y agoTry to call Kotlin co-routines from Java. Telling me there is Kotlin support in Eclipse only tells me you never actually tried it, specially after JetBrains ramped down the team that was doing the now stale plugin.
- Alupis 3y agoYou should look harder before saying it doesn't work. Updated 10/6/2023[1] Coroutines are a specific paradigm within Kotlin, and should not be in library code anyway. With the addition of JVM Virtual Threads, the need for Coroutines is significantly diminished anyway. It's anecdata, yes, but I've written a lot of Kotlin code and do not use coroutines. Kotlin really just lets you do what you want - as much or as little idomatic code as you need. Kotlin on the backend is amazing. You really should give it a try. Java sucks badly, in comparison (I say that as a former Java nerd...) [1] https://marketplace.eclipse.org/content/kotlin-plugin-eclipse https://marketplace.eclipse.org/content/kotlin-plugin-eclips...
- pjmlp 3y agoAnd you should read before posting random links, After installation of the Kotlin plugin the Java plugin is not running anymore. I cannot open a Java project anymore. The log file says: !MESSAGE org/eclipse/jdt/internal/ui/refactoring/actions/RenameJavaElementAction$AjcClosure1 !STACK 0 java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/ui/refactoring/actions/RenameJavaElementAction$AjcClosure1 at org.eclipse.jdt.ui.actions.RenameAction.<init>(RenameAction.java:60) at org.eclipse.jdt.ui.actions.RefactorActionGroup.<init>(RefactorActionGroup.java:372) at org.eclipse.jdt.ui.actions.RefactorActionGroup.<init>(RefactorActionGroup.java:206) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.<init>(PackageExplorerActionGroup.java:139) at ...
- Alupis 3y agoYou copy/pasted an error some random person on the internet had in June due to using an incompatible Eclipse & plugin versions? The beauty of Eclipse is the ecosystem. If that official Jetbrains plugin doesn't do it for you for some reason, then use another one[1]. [1] https://marketplace.eclipse.org/content/enhanced-kotlin-eclipse https://marketplace.eclipse.org/content/enhanced-kotlin-ecli...
- Tainnor 3y ago"Only works on IntelliJ" is patently false. Stop spreading FUD.
- pjmlp 3y agoWhere is Kotlin support for Eclipse and Netbeans? Prove me wrong.
- Alupis 3y agoDo you use Eclipse? Have you looked at the available plugins? There's nothing special about Kotlin. It's a bunch of libraries for runtime and compile time... like anything else you use.
- pjmlp 3y agoIt is my main Java IDE. There is a difference between supporting a language with a Notepad++ like experience, and what JetBrains was doing before ramping down the Eclipse plugin team, as means to sell more InteliJ licenses instead.
- Alupis 3y agoWhat do you believe you are missing? It compiles fine with Maven or Gradle, it provides auto-prompt/complete/hints. It just works.
- pjmlp 3y agoSame experience as in InteliJ, which JetBrains no longer provides. And above all, no crashes left and right.
- Alupis 3y agoI'll ask again more clearly - what is the "same experience" you are missing? Kotlin is plugins for Maven/Gradle, and classpath libraries. There is no magic going on here...
- pianoben 3y agoI've worked in several JVM backend projects, and Kotlin has been a stark improvement over Java (at least up through version 17, the most recent with which I've worked directly). Compose, and Compose UI, are tremendously promising technologies; I've shipped desktop apps with Kotlin for multiple platforms, and compared to just about every other desktop UI framework, it's a clear winner in terms of productivity and an ability to GSD. All that to say, I believe that Kotlin has a lot of value, independently of Android.
- jcadam 3y agoKotlin is the closest thing to a "better Java" that I've found. I've used it with Spring Boot and the interoperability with Java is fantastic. A Java dev would have no problem picking it up quickly (as opposed to Clojure and even Scala). I say this as a Clojure fan, there are many instances where I'd probably choose Kotlin nowadays. You can also mix JVM languages within the same application; I've found it rather useful to sprinkle some Clojure into a Java/Spring application for certain tasks. Maven and Gradle both have tooling to handle it :)
- Alupis 3y agoIf you're into FP stuff, using Arrow within Kotlin takes you to that next level. It even works with Spring/Boot.
- ahoka 3y agoEven C# seems like something stuck in the 1990s compared to Kotlin. (I know it’s not a high bar).
- pjmlp 3y agoNot kept up with the times in regards to C# 12 features?
- Alupis 3y agoC#'s problem is it's quickly becoming C++ in that it doesn't just have the kitchen sink, it has three kitchen sinks... Unlike C++ though, one day the powers that be will just remove features as part of yet-another framework rewrite and you'll just have to deal with it. The other issue is just how tightly coupled C# as a language is to the .NET framework/platform. Some of the things people like C# for are actually framework things and they don't realize it because that separation isn't as clear as with Java and say, JavaEE or Spring or $X. If you talk to a C# developer - of course they're using .NET and of course they're using Entity Framework - to them, there's no other way. It's inconceivable that any other library or framework might do it better than Microsoft's official offering... and then you'll find the official offering to be lacking in fundamental ways. Talk with a Java developer and you'll find there's a lot more diversity of frameworks and libraries being used - so there's a lot more differing opinions on priorities and a lot more good ideas being tried out or implemented everywhere. The communities are vastly different in that regard.
- vips7L 3y agoFor me personally Kotlin does not bring that much to the table over a modern version of Java. Sure if you're stuck in Java 8 it can be a win, but compared to Java 21 it just doesn't bring enough to warrant the switch for me.
- skwirl 3y agoI’ve seen this sentiment a lot and I don’t understand it. I actually feel like very little has been added between Java 8 and Java 21. Virtual threads is probably the biggest thing, and it looks very promising, but the language itself is still a chore to use, and Kotlin does a good job at cleaning a lot of that up. I think Kotlin is at risk, though, of having the JVM force them to support two competing models to accomplish the same thing - coroutines and virtual threads is a good example (although Java still doesn’t have language level structured concurrency). This could really make things messy.
- vips7L 3y ago> I’ve seen this sentiment a lot and I don’t understand it. I just don't think any feature of the language of Kotlin is that much better than Java's implementation. I'm also a big supporter of brevity != clarity when it comes to code. What language feature in Kotlin do you think is that much better?
- Alupis 3y agoI was you not that long ago. I've had the same conversation with a lot of other Java developers too - they/we always say the same things. It's weird being on the other side of the fence now - hearing the same things I used to say. Kotlin was a gateway drug out of not just Java, but OO/Solid and into FP for me (FP being another thing I used to not "get"). The beauty of Kotlin is you don't have to ever write FP code if you don't want to - but you will want to before too long. I would recommend trying it out for yourself. It's Spring integration is amazing, and you'll have a great time. Write even a little Kotlin and you'll have an "ah ha!" moment and everything will forever be different. It's one of those things where you need to experience it for yourself before you actually understand how great it is. There is no argument you will hear that will convince you, sadly. I was the same once...
- peterashford 3y agoI did a year of Kotlin in a recent job. I liked it, but not enough to prefer it over Java - especially with the recent updates to Java. YMMV