4 ms·
Any reason Kotlin is not being adopted outside android? I haven't used Java for like a decade - is it that Java improved well enough to kotlin not being competi
by pzo 3y ago
Any reason Kotlin is not being adopted outside android? I haven't used Java for like a decade - is it that Java improved well enough to kotlin not being competitive anymore? E.g. Spring Boot seems to have kotlin support. Kotlin 2.0 compiler seems also around the corner, same with jetbrains-compose.
- matsemann 3y agoWhen I was a consultant, what I saw was that almost all new code in java codebases at multiple projects/clients was entirely Kotlin. No idea what the person you're replying to is on about.
- pjmlp 3y agoCongratulations, you are part of the 18% Kotlin on JVM and 10% language relevance numbers from the reports I shared.
- dtech 3y ago18% is way too large to just dismiss it as "irrelevant"
- matsemann 3y agoBeing one in six java developers isn't worthy of a congratulations I think, but thanks anyways. But it does show how wrong your statement was about Kotlin only being an Android thing.
- pjmlp 3y agoIt is, because most teams using Kotlin on JVM are Android shops writing server side code. There are other reports to dive into.
- matsemann 3y agoI disagree. I've never been in an "Android shop", and still seen plenty of Kotlin code (all the places I mentioned mainly had React Native apps). You have some preconceptions that probably aren't correct, and try to make all reports fit that narrative. Just accept that lots of people use Kotlin without having anything to do with Android.
- deleted 3y ago[deleted]
- pjmlp 3y agoLike all guest languages on the JVM, its domain outside godfathers' mobile Kingdom won't move the needle to rewrite the Java ecosystem.
- somehnguy 3y agoThis is also the case at my (large) company. We have a lot of Java code around, but anything new is Kotlin. The teams pretty universally strongly prefer it.
- jpgvm 3y agoKotlin is growing in usage. Not as fast on backend obviously because Java is still perfectly serviceable but it's still definitely growing. The area Kotlin excels in isn't as a pure Java replacement to be used by Java devs but rather a JVM language palatable to the Python/Javascript/Ruby/Golang crowd. It's very very hard to convince such people that they should even try Java but Kotlin is much easier to at least get them to try and show them it's really not hard at all.
- pjmlp 3y agoThe Python/Javascript/Ruby crowd has JVM implementations to look for.
- galdosdi 3y agoHad. One of the most egregious destructions of great value in the modern world wasn't the collapse of the Key Bridge or the destruction of the library of Alexandria -- it was when Jython, a wonderful implementation of Python2 on the JVM, died because it was too much effort to upgrade it to support Python3. So much value and capital, destroyed because of the damn 2to3 fiasco. ALL FOR WHAT? For goddamned PRINT STATEMENTS? Now all the libraries have moved on, so Jython is not so useful -- you can do toystuff but you can't import any serious modern python library anymore, which you could a decade ago! And you got real multithreading with no GIL to worry about it! It was ahead of the real CPython2! It was more than just a way to integrate and glue together Java and Python code -- it was actually a viable alternative Python runtime. It's a big reason I've never forgiven or started retrusting the python community after the 2to3 fiasco. It just shows it's not a serious language like java that actually cares about backwards compatibility and is able to advance anyway. Hey, what ever happened to Groovy? It was like Scala/Kotlin but without taking itself seriously at all, much more akin to perl than to C++.
- gbear605 3y agoCheck out GraalPy! It’s like Jython but it’s on Python 3 and supported by Oracle. My company is still using Jython, but we’re finally tearing out our Jython implementation and replacing it with GraalPy since it’s much more performant and it’s going to stay up to date with Python development.
- weatherlight 3y agoSimply inertia. Java is what people know and hire for unfortunately.
- jiehong 3y agoFirst of all, I think many projects just waited before dipping their toes in kotlin. Now that java itself is adding many functionalities inspired from other languages, it's much less appealing. I saw some backend projects at $company, and after 2 or 3 years, the decision was made to only use java on new files, and convert kotlin files to java when they are touched. Why? The kotlin compiler was so much slower that it was noticeable, while javac is still very fast. Another reason is available talent not related to Android. Lastly, its value proposition wasn't high enough to justify a different language, especially with java 17 and later. That being said, even quarkus provides kotlin apis nowadays, so it's not like it doesn't happen.
- ldjkfkdsjnv 3y agoJava pulls in the best language features from kotlin and scala, which reduces the edge of using those languages
- hocuspocus 3y agoThis is an overly simplistic take. Java hasn't taken that much from Kotlin really, sometimes even gone in a completely opposite direction (for instance with Loom). Java has taken a few things from Scala but I would hardly call them the best features. Java will never adopt what truly makes Scala stand out, on purpose.
- matsemann 3y agoWhile java has evolved a lot, I still find it hard to go back. The stream syntax and similar things will never match how easy it is to do proper functional programming in Kotlin. I do miss real pattern matching, though.
- vbezhenar 3y agoJava is good enough and Kotlin does not add anything substantial worth of switching. Google provides first-class support for Kotlin. Oracle does not. Kotlin does not evolve with JVM. For example they introduced coroutines to imitate blocking code and few years later Java decided to create green threads, making the feature essentially obsolete. Kotlin made sense in Java 1.7 time, when Java seemed to be stale and kind of dead. Things changed since then.
- beeboobaa3 3y agoCompilation is slow as balls and there's only 1 viable ide. You're going to have to spend extra time onboarding Java developers and it just doesnt add enough to be worth it
- yafetn 3y agoI think the Jetbrains team are dropping the ball when it comes to Kotlin on the JVM. They seem to be focusing their energy on KMP, and I’m not sure they have the capacity to deal with all the platforms they want to target (Kotlin/JS, Kotlin/Native, Kotlin/JVM, KMP, Jetpack Compose (?) etc). That being said, I’d strongly encourage others to try Kotlin as a Java alternative for server-side applications (Spring Boot integration is really nice, for instance). It’s such a delight to use! And it’s still my favorite language. Some features I especially like: - context receivers (think of them as implicit parameters that are checked at compile-time) - null safety. This is a BIG one, especially if you’re coming from Java. - structured concurrency. Java still doesn’t have this. Note that SC is different from what was introduced in Project Loom. - immutable variables, data classes, value classes etc.
- derriz 3y agoI switched back recently (from Kotlin to Java). I'm not 100% happy with the switch. Despite new Java features, it comes nowhere near providing Kotlin's terseness. But a few of the reasons that made me try this switch include being uncomfortable with the closed and proprietary nature of the Kotlin's evolution and that the only IDE support available is via a product owned by the same company. I know Oracle "owns" Java but it feels different - they have no incentive to limit the marketplace for developer tools and IDEs. I also prefer a smaller languages - and I feel earlier versions of Kotlin were beautifully balanced in this regard with a small(ish) number of powerful and orthogonal improvements over Java. The language has grown significantly since then at a far faster rate than Java - maybe approaching C# velocity. Finally, and I realise that a lot of effort has gone into addressing the issue in recent releases but compile times were much worse for me than equivalent Java.
- Starlevel004 3y agoKotlin has stagnated for the last few years (!) due to JB dropping everything to rewrite the entire compiler (twice). In the meantime, Java took a lot of the good features and made them even better, e.g. Java has actual pattern matching and Kotlin doesn't.