What Are the Three Uses of The Using Statement? - C# Gotcha Interview Questions

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

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

  • @balu.92
    @balu.92 3 ปีที่แล้ว +2

    Haha, great use of comedy while delivering super useful info.

  • @RM-xl1ed
    @RM-xl1ed หลายเดือนก่อน

    I regularly consume geopolitics related Ryan McBeth content. Working on a personal project where I am learning C# and trying to figure out what this "using" stateament does. Did some google searching. Never expected a Ryan Mcbeth coding tutorial on the Using statement in C#, lol

  • @yoshionimusha2636
    @yoshionimusha2636 3 ปีที่แล้ว +4

    Notes: (if you want to copy pasta for later)
    Mnemonic: Dispose a name sister
    dispose - dispose an object
    a name - add a namespace
    SISter - Static Import Single class

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

    Best C# video on the web!

  • @podell111
    @podell111 3 ปีที่แล้ว +1

    Thanks, that was great as are all of your videos. I just had an interview with 2 seemores on the same job interview last week. My head hurt afterwards. I am in job interview hell right now. Keeping a sense of humor helps.

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

    Short, sweet, and to the point. Thanks Ryan.

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

    You know the feeling when you just watched the first 15 seconds of the video and you can already tell the person is going to be extremely annoying? well after watching this you do... the worst part is that the video actually contains useful information it's just being explained like your handsy uncle is talking to you when you're 5

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

    I cannot focus on the content of the video any more because I'm laughing so hard :D

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

    Wouldn't there be four uses, though?
    - using System.Text - akin to import - the one we all already know.
    - using Alias = System.Text
    - using static SomeNamespace
    - using an object that gets disposed once we're out of the using scope.
    Also, super helpful video. I had no idea about the second and third use. I've seen the second one used sometimes, but the static one is completely new for me. And I've been coding for quite some time now.

    • @RyanMcBethProgramming
      @RyanMcBethProgramming  4 ปีที่แล้ว +3

      Yeah, that's why I do this, man. I been on the other end of Seymore and I hate it when good candidates get shot down because they don't know something like that.

  • @abrahameduardoordoricaisla9103
    @abrahameduardoordoricaisla9103 3 ปีที่แล้ว +1

    Great video, pretty cool!

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

    Former danish soldier learning to program watching a former US soldier who learned to program. Perfection

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

    Love it thanks! Really clear and informative

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

    Are these even the same thing semantically in the compiler? I'd argue this is a usage of the using KEYWORD, not a using statement. Not to mention that disposing an object can be done with a using statement or a using block. So that adds another use.
    From what I know the using for a namespace or alias is a using directive, not a using statement. Statements are not allowed outside of a method body.

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

    Thank you!!!!

  • @Campesguy
    @Campesguy 3 ปีที่แล้ว

    This is one less thing now Seymour can try to trip me up on.

    • @RyanMcBethProgramming
      @RyanMcBethProgramming  3 ปีที่แล้ว +1

      My whole objective with this series is to stop Seymore from tripping up your interview.