Hacker News new | past | comments | ask | show | jobs | submit login

While 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.




Try 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.


You 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-eclips...


And 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 ...


You 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-ecli...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: