Object can also be used as a static class, the object is some thing that never instantiate thus a static object no inheritance etc, additionally there is this thing called companion object which is essentially a static class within an instantiatable class, this exist so that it could replace stuff such as manager class that manage other class, now you'll have all the code with the same functionality within the same class and same file e.g. class A A.something() //companion object method a.somrthing() // instance object method
I've been using Kotlin for a few years and I have to say, it is definitely an improvement over Java. One issue I encounter is that most Java libraries weren't built for Kotlin, which can lead to a strange developer experience.
One thing I don’t like is gradle. It’s super slow and prefer maven. A gradle file looks much better but it takes forever to do anything compared to maven in xml.
@@h4ktbtw It is more straight forward and i stated that in my comment but on my intel macos its slower then maven. Idk. Maybe if i got a macbook with the new chips id see how great gradle can be.
I think one cool thing about KMP in comparison to Dart is that it blends in with the target framework. It's not running in some sort of VM (nor is Dart), but it also doesn't need a "bridge" (and the overhead that comes with that) to interact with the underlying platform. For example, Kotlin interacting with Java is literally just Java bytecode calling into a normal JVM function, no bridge, no walls, no conversions. Same with Kotlin/Native. It builds to LLVM bytecode, which then gets merged with C/C++/Swift/Obj-C bytecode, and from there LLVM links everything such that a call from Kotlin to native (or vice versa) is one jmp machine instruction, no other abstractions! And the same applies to JS or Wasm.
In modern IT landscape Java VM is obsolete. All you really need - run one Go binary inside scratch image under any container environment. End of story.
kotlin is well positioned to be the main language for pretty much everything... jetbrains are #1 when it comes to producing tooling for coding and no matter how good your language if it has no proper tooling its doomed... kotlin native will take over low level stuff (so C/C++,Rust,Zig) kotlin jvm already dominates JVM so (see you java) kotlin wasm/js will ultimately cover web they just need to not screw up and continue as they were doing before, the appeal of writing very readable code but having it work for any platform without a VM is going to be huge
I don't think low level is achievable because: 1. JVM is "huge" in that space; 2. Garbage collection is a big no no since it is an unpredictable process.
He's talking about the Kotlin Native runtime (which utilizes LLVM) rather than the JVM, so low level stuff is feasible in that. However, Rust and Zig are inherently better suited for this purpose, as they were designed from the ground up for low-level programming
coincidentally, I just tried Kotlin yesterday with Android Studio, but the IDE is too resource intensive for my liking. is Kotlin any good with VS Code? I heard the tooling is not too good there, or any other IDE beside Jet Brain's in general.
If the IDE really is to slow to actually write in it, then you can mix them. For example, write the code in VS Code, and then go back and forth to Android Studio only for build and debug.
I like the idea of Kotlin multiplatform, but not the focus shift to Compose Multiplatform, running UI on Skia doesn't make sense when Flutter is already dropping that. If they had a native component library/package, it would be much better than knowing how to interoperate with each platform to create the UI (e.g. a simple button) if I dont want to use Compose Multiplatform.
It's already very possible to just use native controls, without including Compose at all, because interop is pretty seamless. However, Compose's ergonomics (IMHO) are much better than Flutter's, in part due to Kotlin's slick syntax, and the fact that it's a compiler plugin that does some compile-time magic to make it all work with minimal code. Aside, it's the main UI framework for Android (and even there it doesn't use the native system components because they're too limited), which opens Android developers to a plethora of other platforms without too much overhead.
You can start by using in in personal projects, then you can propose it for internal tools inside your company. That's how I did it, and it is now the main language we use on the backend :)
@@awesome-coding sadly I already did that and they wouldn't let us use kotlin because we have the whole ecosystem in Java. Moreover we have a custom framework on top of spring boot and it would be a nightmare to migrate it to kotlin
3:34 Maan I've been using Kotlin for more than 2 years and never knew about object expressions, thought I knew everything! I used them before to implement a specific interface, but didn't think they could be used just like that! Super cool for one-off operations where creating a class is overkill!
I like Kotlin, but it's a deadborn. 1. I/O is very slow, even slower than Java, i had a lot of problem with Competitive programming usually converting the same code to Java solves everything. 2. Way to much useless features. Val and Var are stupid concept, there is no risk of null or memory safety with simple types, but when you define mutableListOf or unMutableListOf - you basically write something twice. I saw a lot of code in Kotlin, there is absolutely no need for Val and Var. But there are a lot more redundant or useless features. 3. Language still in active development, it's not a C++ specifications, Kotlin recieve new updates that breaks old code, and over all it's not improving anything. 4. Compose is promising, but it's a half baked, i don't see real market for it, it don't solve any new problems, it's just as bad as any other option. 5. Kotlin is way to much focused on Android, as i observe wat Google is doing with ChromOS and FlexOS, they probably will abandon Java and Kotlin in development pipeline in future.
@@awesome-coding yes in js, and c# even in cpp and even in dart it is between () and it is just really strange to look at it in kotlin, I am thinking about trying out kotlin, the multplatform with compose looks nice, but will see...