"Don't use the Java ecosystem. It's junk and Oracle is just waiting to fuck all of you." There's my crash course in Kotlin
Kotlin Compiler Crash Course
31–40 of 51 posts
Re: Kotlin Compiler Crash Course
#32Earlier quoted context omitted.
Oracle does a really good job improving the Java language. I really don't see any reason for why I should start using Kotlin. I use Groovy when I just need to do something fast without all the boilerplate code. But for 95% of the business problems, plain old Java is exactly what I need. For anything else, its Rust, Python, Javascript that shines in each of their category.
Oracle is doing a good job adding features to Java to keep up with modern languages, but it’s not just about adding — some things need to be removed or changed. By way of example: Final classes by default with an open keyword instead of open by default with a final keyword. Inheritance is a very tricky thing to get right and it’s better to explicitly say “I thought about this and put in the effort to make it work”. C…
A lot of those are almost philosophical differences, though. A Java feature that is unambiguously bad, but probably impossible to remove, is the different equality semantics between atomic types and their boxed versions.
Re: Kotlin Compiler Crash Course
#33"Don't use the Java ecosystem. It's junk and Oracle is just waiting to fuck all of you." There's my crash course in Kotlin
Re: Kotlin Compiler Crash Course
#34"Don't use the Java ecosystem. It's junk and Oracle is just waiting to fuck all of you." There's my crash course in Kotlin
Kotlin is made by JetBrains and additionally compiles to native code and JavaScript, OpenJDK is open source, Google has their own JVM for Android. You could use Kotlin pretty much everywhere with no/only indirect Oracle contact.
We're talking about a company that sued it's own salesperson for earning too high of a commission.
Re: Kotlin Compiler Crash Course
#35Re: Kotlin Compiler Crash Course
#36Earlier quoted context omitted.
I was under the impression that openjdk was independent from Oracle?
Oracle owns the IP of Java, and begrudgingly allows such things as openjdk.
Re: Kotlin Compiler Crash Course
#37Earlier quoted context omitted.
Kotlin is made by JetBrains and additionally compiles to native code and JavaScript, OpenJDK is open source, Google has their own JVM for Android. You could use Kotlin pretty much everywhere with no/only indirect Oracle contact.
Oracle owns Java, plain and simple. There are alternatives, sure, but it's foolish to think that when it comes to anything within the Java ecosystem, the buck doesn't stop with Oracle. All they have to do is modify the Java license and all that open source goes poof . We're talking about a company that sued it's own salesperson for earning too high of a commission.
Meanwhile the Oracle vs Google case is still going on.
Re: Kotlin Compiler Crash Course
#38How's Kotlin compilation story to JavaScript? Can we do frontend in Kotlin?
Basically, to stay on topic, there are currently multiple kotlin compilers, including one that transpiles to Javascript. There is also tooling to interface with npms, to adapt typescript type mappings to Kotlin, and a few more goodies. Basically you lose the java standard library but you gain access to the browser APIs. Node API mappings are more of a work in progress but you should be able to target node.js as well. Browser side kotlin-js is pretty nice. You can do pretty much everything that you would normally do in js/ts. The build tooling uses gradle, which underneath uses webpack. There's a dead code eliminator, source maps, minification, etc.
Our web app uses cordova (for IOS and Android wrappers) with a few plugins, integrates Leaflet for maps, has reactive components (using co-routines and flows), has styled components, etc. So, pretty nice and modern way to do frontend. We have a handful of js things we integrate (like leaflet) and quite a few Kotlin multi platform things (like our own API client).
There is also a js backend for the new IR compiler, which is the thing that Jetbrains is currently building to unify the many Kotlin compilers they have. There is also a wasm compiler backend for that in the works but it's to early to rely on that probably. The IR to JVM backend is currently in beta and kotlin native also uses the IR compiler.
Kotlin-js is not for everyone just yet (a lot of these tools are beta quality) but if you are more comfortable with Kotlin than js/ts, it's worth checking out. That being said, our setup is quite nice compared to some react train wrecks I've been involved with.
Re: Kotlin Compiler Crash Course
#39Kotlin is one of those things that I avoided learning for so long just because I didn't want to learn another new thing. And one day I had to work on a project that was 100% kotlin and so i decided to do a 3 hour crash course on Youtube (actually watched it at 3x speed so it was really 1 hour) and once I grasped the basics it really made so much sense and I don't think I'm ever going back to writing Java classes anym…
Java developers are rightfully conservative and sceptical of "new things". That said I believe Kotlin really provides a strong value proposition over Java. You also don't sacrifice much, there is less tools ofc but enough to get by, performance is equal for the most part etc. Also unlike stuff like CS it has a very strong future with Android backing.
Highly ironic since Java was the hot, shiny, and new thing when it came out.
Re: Kotlin Compiler Crash Course
#40Earlier quoted context omitted.
Java developers are rightfully conservative and sceptical of "new things". That said I believe Kotlin really provides a strong value proposition over Java. You also don't sacrifice much, there is less tools ofc but enough to get by, performance is equal for the most part etc. Also unlike stuff like CS it has a very strong future with Android backing.
> Java developers are rightfully conservative and sceptical of "new things". Highly ironic since Java was the hot, shiny, and new thing when it came out.