Every Kind of Class in Kotlin

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

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

  • @ArthurKhazbs
    @ArthurKhazbs 7 หลายเดือนก่อน +27

    Another thing to remember is that in Kotlin, unlike in Java, regular classes are final by default, which means they cannot be subtyped. To make a class open for subtyping, it has to be marked with the "open" modifier.

    • @typealias
      @typealias  7 หลายเดือนก่อน +5

      Yes, thank you for pointing that out, Arthur!

    • @pookiepats
      @pookiepats 8 วันที่ผ่านมา

      Oo i love that!! Is “final class” a way of restricting inheritance a la Swift?

  • @foreverrafs
    @foreverrafs 7 หลายเดือนก่อน +26

    I like your presentation style, very succint and straight to the point

    • @typealias
      @typealias  7 หลายเดือนก่อน

      Great, thank you so much!

    • @yassine-sa
      @yassine-sa 2 หลายเดือนก่อน

      Yes! It also gives confidence to the learner that he’s in good hands 😁

  • @Alchemist10241
    @Alchemist10241 7 หลายเดือนก่อน +5

    using @Nested inside the test class tip was awesome, most of the time naming test cases is difficult for me but by grouping them using @Nested, naming would be much easier and straight forward. great video by the way

    • @typealias
      @typealias  7 หลายเดือนก่อน +1

      Thanks! Yeah, once I started using `@Nested` in those JUnit 5 tests, I really missed it on the occasions when I had to return to JUnit 4.

    • @kqvanity
      @kqvanity 7 หลายเดือนก่อน

      @@typealias When do you usually revert back to JUnit4? For me, it's usually when interacting with Roboelectric or such

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

      I started combining this with Display name and the test output reads beautifully, specially with parametrized tests

  • @Doruko666
    @Doruko666 7 หลายเดือนก่อน +5

    I don't know where did you come up, but you're the great teacher a lot of us never had. Keep on the good work Dave :)

    • @typealias
      @typealias  7 หลายเดือนก่อน +1

      I appreciate that - thanks so much! I'll keep at it!

  • @hhhapz
    @hhhapz 7 หลายเดือนก่อน +6

    This is a great video, but this video also embodies my biggest gripe with Kotlin. It feels like every potential feature that could maybe be useful in any circumstance was indiscriminately added to the language. Useful, yes, but it gives every single project a different feel and makes it difficult to find consistency, sometimes even within the same project. This is especially felt when using different libraries together.

    • @typealias
      @typealias  7 หลายเดือนก่อน +3

      I can understand that perspective - that's actually how I felt about Groovy. I found it to be a very capable language, but there were so many features and options - even blending dynamic and static typing - that it didn't seem to have a sense of direction, and I suspect even detracted from adoption. I'm hoping Kotlin will avoid _that_ level of feature sprawl - it's a good concern to keep in mind, for sure!

  • @scottbiggs8894
    @scottbiggs8894 6 หลายเดือนก่อน +1

    Just found your channel. Nice video: cleanly produced, smartly packaged, and thorough without being tedious. Thank you.
    Hmm, never used value classes before--talk about boilerplate code!!! That is sooooo awkward, just to catch a parameter error. But that's kotlin for you: tons of extra work in order to keep bad programmers from making mistakes. Give me plain ol C any day (or Lisp).

  • @ivanvega9100
    @ivanvega9100 7 หลายเดือนก่อน +3

    I really like your teaching style, thank you!

    • @typealias
      @typealias  7 หลายเดือนก่อน

      Thank you so much! I'm glad you like it!

  • @superhumandose
    @superhumandose 7 หลายเดือนก่อน +1

    Thank you soo much Dave, you are a gift to all beginners

    • @typealias
      @typealias  7 หลายเดือนก่อน

      Hey, you're welcome! It took a while to get around to it, but I appreciate you requesting this one!

  • @kqvanity
    @kqvanity 7 หลายเดือนก่อน +1

    I usually have a hard time when the examples are contrived, but yours are great : )

    • @typealias
      @typealias  7 หลายเดือนก่อน +1

      Thank you for saying that - I try my best to come up with examples that fit well!

  • @husammuala
    @husammuala 7 หลายเดือนก่อน +2

    Thank you so much Dave your tutorials are always helpful

    • @typealias
      @typealias  7 หลายเดือนก่อน +1

      Thank you so much! I'm glad you like them!

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

    Can I just say after watching a few of your videos, I'm inspired to improve my vocabulary. Too often I use terminology inappropriately, and your usage makes it so much clearer to understand!

    • @typealias
      @typealias  3 หลายเดือนก่อน +1

      Hey, that's great, Aaron! And I appreciate you saying that - I do aim to use precise terms, and I'm so glad to hear it's helping to make things easier to understand!

  • @Amejonah
    @Amejonah 7 หลายเดือนก่อน +1

    8:20 I generally use sealed interfaces for that, because they don't store any state and are purely for grouping these sub-classes into a single type.
    Unfortunately, the youtrack issue KT-50630/Script-false-positive-NOELSEINWHEN-for-sealed-interface-hierarchy appeared and limits it in when clauses, which is kinda sad at the moment.
    I'd argue that sealed classes are to take when it needs to be scoped and have a common property, whereas interfaces should be used as a default.

  • @bluediamond1965
    @bluediamond1965 2 หลายเดือนก่อน

    Didnt expected it, but I learned few things on the way. TY!

  • @ronny3060
    @ronny3060 2 หลายเดือนก่อน

    That camera quality, voice and background. Wow

    • @typealias
      @typealias  2 หลายเดือนก่อน +1

      Hey, thanks so much, Ronny! Glad you're happy with the production quality!

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

    super nice video, straight to point , also amazing voice and background, thanks a lot ❤

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

    Greate Video, great illustration, great job, thanks Dave....easy to follow

  • @UsmonWasTaken
    @UsmonWasTaken 7 หลายเดือนก่อน +3

    The people who haven't subscribed to Dave are probably gonna miss a lot of things 😅

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

    Nice video. Thanks

  • @calixtoandrade996
    @calixtoandrade996 6 หลายเดือนก่อน

    great video
    thanks

  • @CommanderSteps
    @CommanderSteps 7 หลายเดือนก่อน

    Well done!

  • @bernard-ng
    @bernard-ng 7 หลายเดือนก่อน

    This is what I was looking for 😊🎉

  • @ivastojkovic7904
    @ivastojkovic7904 7 หลายเดือนก่อน

    Great stuff!

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

    Awsm

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

    Just pick Golang. no more confusion - done.

  • @baer126
    @baer126 7 หลายเดือนก่อน

    I wanted to learn kotlin, do I need to learn Java?

    • @typealias
      @typealias  6 หลายเดือนก่อน

      Hey Dani! You can certainly learn Kotlin without knowing Java. Sometimes, knowing Java can be a bonus, and could be helpful if you wanted to use a Java library in Kotlin, for example.
      You're welcome to start learning Kotlin here: typealias.com/start. In that online book, I don't expect the reader to have any prior Java experience. There are a few occasions where I mention things that might be helpful for someone who is coming from Java, but that's about it. Let me know how it goes as you start learning Kotlin!

  • @gangsterism
    @gangsterism 12 วันที่ผ่านมา

    thumb up

  • @zeusalmighty6740
    @zeusalmighty6740 7 หลายเดือนก่อน

    Object?

    • @typealias
      @typealias  7 หลายเดือนก่อน +1

      Yeah, I decided not to include `object` since it's not quite in the same category... e.g., you can create nested objects and data objects. Might have made a good honorable mention, though!

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

    Freshers can’t understand ur vdos