Write Once, Run Anywhere

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ต.ค. 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.cl...
    🥇 Become a Member - / @awesome-coding
    ✉️ Join the Newsletter - newsletter.awe...

ความคิดเห็น • 86

  • @wlockuz4467
    @wlockuz4467 4 หลายเดือนก่อน +76

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

    • @memes_gbc674
      @memes_gbc674 4 หลายเดือนก่อน +7

      can confirm, i cant go back visual studio

    • @virockorg
      @virockorg 4 หลายเดือนก่อน +1

      I dislike how async code is written in kotlin

  • @avi12
    @avi12 4 หลายเดือนก่อน +52

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

  • @TechBuddy_
    @TechBuddy_ 4 หลายเดือนก่อน +18

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

  • @Shpitzick
    @Shpitzick 4 หลายเดือนก่อน +11

    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  4 หลายเดือนก่อน +4

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

  • @lucasteo5015
    @lucasteo5015 4 หลายเดือนก่อน +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

  • @jaymartinez311
    @jaymartinez311 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +1

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

    • @jaymartinez311
      @jaymartinez311 4 หลายเดือนก่อน

      @@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 4 หลายเดือนก่อน +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

  • @brunoggdev6305
    @brunoggdev6305 4 หลายเดือนก่อน +7

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

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน

      Glad to hear! Good luck trying it!

  • @zill_laiss
    @zill_laiss 4 หลายเดือนก่อน +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.

    • @unknownguywholovespizza
      @unknownguywholovespizza 4 หลายเดือนก่อน +1

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

    • @elishasamuel6328
      @elishasamuel6328 4 หลายเดือนก่อน

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

    • @Leonhart_93
      @Leonhart_93 4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +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.

  • @oglass
    @oglass 4 หลายเดือนก่อน +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.

  • @Thassalocracy
    @Thassalocracy 4 หลายเดือนก่อน +2

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

  • @ahmedtohamy2188
    @ahmedtohamy2188 3 หลายเดือนก่อน

    But no good resource to learn kmp

  • @guglielmobartelloni
    @guglielmobartelloni 4 หลายเดือนก่อน +4

    I wish my company could let me use it

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +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  4 หลายเดือนก่อน +1

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

  • @memes_gbc674
    @memes_gbc674 4 หลายเดือนก่อน +3

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

    • @5uryaprakashPi
      @5uryaprakashPi 4 หลายเดือนก่อน

      C# and Ruby are my dream programming languages😊

    • @CodecrafterArtemis
      @CodecrafterArtemis 4 หลายเดือนก่อน

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

  • @BorisTheDev
    @BorisTheDev 4 หลายเดือนก่อน +1

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

  • @ДмитрийКарпич
    @ДмитрийКарпич 4 หลายเดือนก่อน

    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.

  • @infinitebeast5517
    @infinitebeast5517 4 หลายเดือนก่อน +5

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

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน

      It's on the short list!

  • @เฟิร์สอัศวินนมผงฯ
    @เฟิร์สอัศวินนมผงฯ หลายเดือนก่อน

    awesome

  • @rahulagarwal968
    @rahulagarwal968 4 หลายเดือนก่อน +2

    kotlin multiplatform vs Flutter ?

    • @HoussamElbadissi
      @HoussamElbadissi 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +1

      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.

  • @Niksorus
    @Niksorus 4 หลายเดือนก่อน +3

    Great intro to Kotlin!

  • @dei8bit
    @dei8bit 4 หลายเดือนก่อน +2

    ?: elvis operator xD

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +2

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

    • @dei8bit
      @dei8bit 4 หลายเดือนก่อน +1

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

  • @Kal.99
    @Kal.99 4 หลายเดือนก่อน

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

  • @Iswimandrun
    @Iswimandrun 4 หลายเดือนก่อน

    Isn't android leaking DNS?

  • @smoked-old-fashioned-hh7lo
    @smoked-old-fashioned-hh7lo 4 หลายเดือนก่อน

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

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +1

      Inheritance is not imposed by design in Kotlin.

    • @smoked-old-fashioned-hh7lo
      @smoked-old-fashioned-hh7lo 4 หลายเดือนก่อน

      @@awesome-codingthat's good to know, thanks

  • @mawill432
    @mawill432 4 หลายเดือนก่อน +2

    Do elixir next

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +1

      Erlang, Elixir and Gleam ar on the short list!

    • @mawill432
      @mawill432 4 หลายเดือนก่อน

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

  • @hamzakhiar3636
    @hamzakhiar3636 4 หลายเดือนก่อน +1

    isn't dart also a write once run anywhere ?

    • @lazyalpaca7
      @lazyalpaca7 4 หลายเดือนก่อน

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

    • @tabletuser123
      @tabletuser123 4 หลายเดือนก่อน

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

    • @hamzakhiar3636
      @hamzakhiar3636 4 หลายเดือนก่อน

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

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน

      @hamzakhiar3636 Kotlin is developed by JetBrains.

  • @HoussamElbadissi
    @HoussamElbadissi 4 หลายเดือนก่อน +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!

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +1

      Yep! Very similar to object literals in JS, which is really useful!

    • @alihaiderkhokhar92
      @alihaiderkhokhar92 4 หลายเดือนก่อน +1

      same here.

  • @krellin
    @krellin 4 หลายเดือนก่อน +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 4 หลายเดือนก่อน +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  4 หลายเดือนก่อน +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 4 หลายเดือนก่อน

      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

  • @mlvki
    @mlvki 4 หลายเดือนก่อน

    its time for php my brother

  • @d1namis
    @d1namis 4 หลายเดือนก่อน +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.

  • @nepalxplorer
    @nepalxplorer 4 หลายเดือนก่อน

    Do C# video as well!!

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +1

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

    • @luc9volts
      @luc9volts 4 หลายเดือนก่อน +1

      Way better than Kotlin

  • @LearnWithHarsh-wb8hg
    @LearnWithHarsh-wb8hg 4 หลายเดือนก่อน

    First ❤

  • @RusydyMuhiddin
    @RusydyMuhiddin 4 หลายเดือนก่อน

    Second 🎉

  • @bishbashboshjt
    @bishbashboshjt 4 หลายเดือนก่อน

    Kotlin took everything from scala

  • @JLarky
    @JLarky 4 หลายเดือนก่อน

    Do one for Swift

  • @md.redwanhossain6288
    @md.redwanhossain6288 4 หลายเดือนก่อน

    Wow, a copycat of C#.

  • @markpolak8317
    @markpolak8317 4 หลายเดือนก่อน

    Why the lambda expressions look so bad

    • @awesome-coding
      @awesome-coding  4 หลายเดือนก่อน +2

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

    • @markpolak8317
      @markpolak8317 4 หลายเดือนก่อน

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