Return and Throw with the Elvis Operator | Kotlin Tips

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

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

  • @churraskindequeijo8418
    @churraskindequeijo8418 2 ปีที่แล้ว +39

    The best thumbnail ever

    • @Kotlin
      @Kotlin  2 ปีที่แล้ว +5

      True

    • @sebastianaigner9125
      @sebastianaigner9125 2 ปีที่แล้ว +5

      Probably my favorite part of creating these videos! 🤣

  • @henninghoefer
    @henninghoefer 2 ปีที่แล้ว +11

    I think Seb has achieved peak thumbnail!
    (also, I really liked the opening gag "Today Elvis returns. Or maybe he throws.")

    • @sebastianaigner9125
      @sebastianaigner9125 2 ปีที่แล้ว

      I'm always trying to make each thumbnail more interesting than the last! 🤣

  • @cicerohellmann
    @cicerohellmann 2 ปีที่แล้ว +11

    Man, I really appreciate this videos, it feels really chilll, you learn something new and and it's always enjoyable to hear someone that is enjoying it.
    Thank you

    • @sebastianaigner9125
      @sebastianaigner9125 2 ปีที่แล้ว +1

      I'm glad you're enjoying the vibe and are learning something new with my videos, Projeto!

  • @DanielThirion
    @DanielThirion 2 ปีที่แล้ว +5

    Seb, your thumbnails are so funny. Keep on going.

  • @DeadlyAlive...
    @DeadlyAlive... 2 ปีที่แล้ว +6

    To avoid nulls in Strings I prefer to put a ?:"" at the end.
    I call it Elvis duck face.

  • @cockyboby
    @cockyboby 2 ปีที่แล้ว

    Wow what a lesson! Whats next? Dot operator?

  • @abhimanyu.n14
    @abhimanyu.n14 2 ปีที่แล้ว

    I like elvis like this as well.
    If a function has a nullable parameter, we can use
    variable_name ?: return (or throw as required)
    This is without assigning it to a new variable.

  • @raphaeltarita5187
    @raphaeltarita5187 2 ปีที่แล้ว

    this Nothing return type of certain keywords is pretty wild, it actually allows for some, well, not really useful, but pretty funny expressions. As an example, if a function takes a parameter of type T, then you can actually call it by supplying 'return' as the parameter: function(return). This doesn't actually "do" anything at runtime, it's just funny how this is actually a valid expression to the compiler

  • @park2348190
    @park2348190 2 ปีที่แล้ว

    'nothing' type! impressive

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

    I'm not sure what c or c++ operator you could be referring to as similar to ?: unless you're thinking of some language extension?

  • @JoseGarcia-bn6kq
    @JoseGarcia-bn6kq 2 ปีที่แล้ว +2

    Could you explain variance and covariance in one of these videos? 😜

  • @rafaeldelacosta1811
    @rafaeldelacosta1811 2 ปีที่แล้ว +1

    that thumbnail tho :))

  • @xetra1155
    @xetra1155 2 ปีที่แล้ว

    Would you rather use elvis or the helper functions `check()` or `require()` to assure that the following code is reasonable?

  • @Mohit-il9gx
    @Mohit-il9gx 2 ปีที่แล้ว +4

    It's been 4-5 years of kotlin js + react native still no one is using it (or handful ) company's are using it ..?? Did kotlin js failed....??? What are guys doing you have to be aggressive in marketing your product make kotlin js popular upload videos of cloning some popular website. introduce this language course in university make this language popular or every is gonna move towards flutter or javascript framework for web

  • @ibrahimal-zaidi6436
    @ibrahimal-zaidi6436 2 ปีที่แล้ว

    That is good.
    My question is how to study data structure in kotlin?
    It would be helpful if you can recommend me some resources.

  • @ananthababu8272
    @ananthababu8272 2 ปีที่แล้ว +2

    👏👏👏

  • @TimSchraepen
    @TimSchraepen 2 ปีที่แล้ว

    Yay! Result type next? 😬

    • @sebastianaigner9125
      @sebastianaigner9125 2 ปีที่แล้ว +1

      Honestly, great idea Tim! Seems worth covering in a future tip!

  • @nguyencodervn
    @nguyencodervn ปีที่แล้ว

    Thank

  • @lukalukovic5082
    @lukalukovic5082 2 ปีที่แล้ว

    Can anyone explain to me the double colon operator :: in kotlin?

  • @sid.h
    @sid.h 2 ปีที่แล้ว

    You can also
    foo?.let {
    // do something that is conditional on foo existing but that doesn't require the explicit handling of the null case
    }

  • @ДмитрийБречко-м9с
    @ДмитрийБречко-м9с 2 ปีที่แล้ว

    Thanks i like this videos

  • @GakisStylianos
    @GakisStylianos 2 ปีที่แล้ว +1

    I came here just to praise the thumbnail 😅

  • @uwumarie
    @uwumarie 2 ปีที่แล้ว +1

    Wow what a Thumbnail

  • @cipriandroid
    @cipriandroid 2 ปีที่แล้ว

    Title should contain ?: instead of :?

  • @MsCpktnwt
    @MsCpktnwt 2 ปีที่แล้ว

    Hello guys I am using opencv with Kotlin in android. And I want to find Contours but in c++ we have vec4i but in Kotlin what I have to use .

  • @Zeeshan-Syed
    @Zeeshan-Syed 2 ปีที่แล้ว +1

    Or we can run a run {} block.

  • @karthickpotter2211
    @karthickpotter2211 2 ปีที่แล้ว

    I read as "evil is back"

    • @Kotlin
      @Kotlin  2 ปีที่แล้ว

      😄

  • @alco8864
    @alco8864 2 ปีที่แล้ว +2

    ?:)

  • @guai9632
    @guai9632 ปีที่แล้ว

    Elvis was stolen^W borrowed from groovy. why didn't you mention it?