Write Once, Run Anywhere

Поділитися
Вставка
  • Опубліковано 5 тра 2024
  • A quick look at the Kotlin programming language.
    💬 Topics:
    - What is Kotlin?
    - Advantages of Kotlin;
    - Kotlin, Java and the JVM
    - Immutability in Kotlin;
    - Kotlin code examples;
    - Kotlin crash course;
    - Kotlin advanced features;
    📖 Blog Article - www.awesome.club/blog/2024/ko...
    🥇 Become a Member - / @awesome-coding
    ✉️ Join the Newsletter - newsletter.awesome.club/

КОМЕНТАРІ • 85

  • @avi12
    @avi12 2 місяці тому +51

    0:00 "Write once, -run- debug anywhere"
    I see what you did there

  • @wlockuz4467
    @wlockuz4467 2 місяці тому +73

    If it's made by JetBrains, you can be rest assured that it'll be a pleasure to work with.

    • @memes_gbc674
      @memes_gbc674 2 місяці тому +7

      can confirm, i cant go back visual studio

    • @virockorg
      @virockorg 2 місяці тому +1

      I dislike how async code is written in kotlin

  • @TechBuddy_
    @TechBuddy_ 2 місяці тому +18

    Lol "write once debug anywhere" was a banger start 😂

  • @lucasteo5015
    @lucasteo5015 2 місяці тому +4

    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

  • @brunoggdev6305
    @brunoggdev6305 2 місяці тому +7

    Damn you really made me want to give it a try after I've delayed it for so long... great job

  • @oglass
    @oglass 2 місяці тому +4

    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.

  • @Niksorus
    @Niksorus 2 місяці тому +3

    Great intro to Kotlin!

  • @jaymartinez311
    @jaymartinez311 2 місяці тому +5

    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
      @h4ktbtw Місяць тому +1

      For me gradle seems more straightforward and actually runs faster than maven

    • @jaymartinez311
      @jaymartinez311 Місяць тому

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

    • @h4ktbtw
      @h4ktbtw Місяць тому +1

      @@jaymartinez311 it can the intel chip’s fault. I don’t really remember how it felt on one of these. However it is flying on M1/M1 Pro

  • @zill_laiss
    @zill_laiss 2 місяці тому +5

    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.

    • @thecoolnewsguy
      @thecoolnewsguy 2 місяці тому +1

      Yes vs code's Kotin support is trash idk why it didn't get support for it

    • @elishasamuel6328
      @elishasamuel6328 2 місяці тому

      If you want to do native android development then sadly, Android Studio is all you got.

    • @Leonhart_93
      @Leonhart_93 Місяць тому

      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.

  • @sambaotaku
    @sambaotaku 2 місяці тому +4

    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.

    • @HoussamElbadissi
      @HoussamElbadissi 2 місяці тому +3

      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.

  • @HoussamElbadissi
    @HoussamElbadissi 2 місяці тому +6

    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!

  • @infinitebeast5517
    @infinitebeast5517 2 місяці тому +5

    Cool video, it would be interesting to see one on dart/flutter

  • @BorisTheDev
    @BorisTheDev Місяць тому

    I still love Scala more. 😃
    Anyway, nice video!

  • @memes_gbc674
    @memes_gbc674 2 місяці тому +3

    damn i might learn kotlin... looks a lot like c# and ruby

    • @5uryaprakashPi
      @5uryaprakashPi 2 місяці тому

      C# and Ruby are my dream programming languages😊

    • @CodecrafterArtemis
      @CodecrafterArtemis Місяць тому

      To be it looks very much like the good parts of Python and Ruby brought onto JVM.

  • @mawill432
    @mawill432 2 місяці тому +2

    Do elixir next

    • @awesome-coding
      @awesome-coding  2 місяці тому +1

      Erlang, Elixir and Gleam ar on the short list!

    • @mawill432
      @mawill432 Місяць тому

      @@awesome-coding But Elixir first... right? 😅

  • @sanampakuwal
    @sanampakuwal 2 місяці тому

    Do C# video as well!!

    • @awesome-coding
      @awesome-coding  2 місяці тому +1

      I have little experience in C#, so I could't confidently talk about it :(

    • @luc9volts
      @luc9volts 2 місяці тому +1

      Way better than Kotlin

  • @Iswimandrun
    @Iswimandrun 2 місяці тому

    Isn't android leaking DNS?

  • @guglielmobartelloni
    @guglielmobartelloni 2 місяці тому +4

    I wish my company could let me use it

    • @awesome-coding
      @awesome-coding  2 місяці тому +1

      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 :)

    • @guglielmobartelloni
      @guglielmobartelloni 2 місяці тому +1

      @@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

    • @awesome-coding
      @awesome-coding  2 місяці тому +1

      @@guglielmobartelloni Ah, I understand :( Sorry to hear that

  • @rahulagarwal968
    @rahulagarwal968 2 місяці тому +2

    kotlin multiplatform vs Flutter ?

    • @HoussamElbadissi
      @HoussamElbadissi 2 місяці тому +1

      I think you mean one of these:
      1. Kotlin Multiplatform vs. Dart (the language)
      2. Compose Multiplatform vs. Flutter (the UI frameworks)

    • @HoussamElbadissi
      @HoussamElbadissi 2 місяці тому

      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.

  • @Thassalocracy
    @Thassalocracy 2 місяці тому +2

    Anything is better than public static void main string[ ] args 😛

  • @Shpitzick
    @Shpitzick 2 місяці тому +9

    Beautiful language but the soft lock-in to IntelliJ (because it's the only real way of developing Kotlin) makes it irrelevant for me, at least.

    • @awesome-coding
      @awesome-coding  2 місяці тому +4

      This is a really good point. You are right, IntelliJ is pretty much a must for a good developer experience.

  • @hamzakhiar3636
    @hamzakhiar3636 2 місяці тому +1

    isn't dart also a write once run anywhere ?

    • @lazyalpaca7
      @lazyalpaca7 2 місяці тому

      pretty much, but i don't know about server end though

    • @tabletuser123
      @tabletuser123 2 місяці тому

      Expect dart to lose support soon, google is addicted to abandoning projects

    • @hamzakhiar3636
      @hamzakhiar3636 2 місяці тому

      ​@@tabletuser123so is kotlin made by Google and go as well

    • @awesome-coding
      @awesome-coding  2 місяці тому

      @hamzakhiar3636 Kotlin is developed by JetBrains.

  • @Kal.99
    @Kal.99 2 місяці тому

    For kotlin to take off, we first need to see spring boot running

  • @dei8bit
    @dei8bit 2 місяці тому +2

    ?: elvis operator xD

    • @awesome-coding
      @awesome-coding  2 місяці тому +2

      yep! that's how they call it because it kind of resembles Elvis Presley 😂

    • @dei8bit
      @dei8bit 2 місяці тому +1

      @@awesome-coding love the name, should be that

  • @JLarky
    @JLarky 2 місяці тому

    Do one for Swift

  • @mlvki
    @mlvki 2 місяці тому

    its time for php my brother

  • @smoked-old-fashioned-hh7lo
    @smoked-old-fashioned-hh7lo 2 місяці тому

    kotlin seems like a great language, but i really don't like oop and inheritance. i prefer composition through data structures.

  • @krellin
    @krellin 2 місяці тому +2

    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

    • @mythbuster6126
      @mythbuster6126 2 місяці тому +1

      The only thing Kotlin dominates and will continue to dominate is Android development, there are much better options for other applications

    • @awesome-coding
      @awesome-coding  2 місяці тому +4

      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.

    • @mrwhoknows
      @mrwhoknows 2 місяці тому

      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

  • @user-hn1ph6ry8l
    @user-hn1ph6ry8l Місяць тому

    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.

  • @ahmedtohamy2188
    @ahmedtohamy2188 29 днів тому

    But no good resource to learn kmp

  • @RusydyMuhiddin
    @RusydyMuhiddin 2 місяці тому

    Second 🎉

  • @LearnWithHarsh-wb8hg
    @LearnWithHarsh-wb8hg 2 місяці тому +1

    First ❤

  • @bishbashboshjt
    @bishbashboshjt 2 місяці тому

    Kotlin took everything from scala

  • @d1namis
    @d1namis 2 місяці тому +3

    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.

  • @markpolak8317
    @markpolak8317 2 місяці тому

    Why the lambda expressions look so bad

    • @awesome-coding
      @awesome-coding  2 місяці тому +2

      What do you mean? because of the () being dropped?

    • @markpolak8317
      @markpolak8317 2 місяці тому

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

  • @md.redwanhossain6288
    @md.redwanhossain6288 2 місяці тому

    Wow, a copycat of C#.