Learn C# for beginners: 42 - Pass by Reference vs Pass by Value

Поділитися
Вставка
  • Опубліковано 13 бер 2015
  • If you enjoyed this video please comment below and give me a thumbs up! It goes a long way.
    If you want to keep watching these videos make sure to subscribe!
    You can contact me at:
    Twitter: / jdprogramming
    For business Inquires please email at: JDProgramming@Outlook.com

КОМЕНТАРІ • 38

  • @shaunhunterit342
    @shaunhunterit342 2 роки тому +1

    You've earned yourself a fan with this video Jesse. Loving your work.

  • @bunburyLZD
    @bunburyLZD 3 роки тому

    I'd been on the edge of despair trying and failing to understand this concept. This video saved my assignment, and me. Thank you🙏🏻

  • @TheK3nn13y
    @TheK3nn13y 7 років тому +2

    Super Helpful video was struggling understanding other videos but this one definitely is the one and only one to watch.

  • @blanchsb
    @blanchsb 5 років тому

    I have studied this many times but this is the first explanation I have received that is dumbed down enough for me to understand better than before. Thanks!

    • @xieulong
      @xieulong 5 років тому +2

      Maybe it wasn't dumbed down, maybe it was just explained well.

  • @videolosss
    @videolosss 2 роки тому

    Thanks Jesse. I’ve been writing C# for years and needlessly making the return type of the function another instance of the type. Simple yet important info.

  • @letsbye
    @letsbye 4 роки тому

    Rather than a whiteboard session, this drives the point home much clearly as to where values/references are useful and why so. thanks for your time..!!

  • @supersonic_rocket_ship
    @supersonic_rocket_ship Рік тому

    I'm so glad I found this video and your channel! You're great at explaining things and your voice is really soothing. Thank you so much for teaching us noobs :D

  • @mitch761
    @mitch761 2 роки тому

    Thank you very much, left a like because it's a good video

  • @mementomori8930
    @mementomori8930 Рік тому

    You are a great explainer. I hope you know that.

  • @masteredconcepts188
    @masteredconcepts188 5 років тому

    awesome!!!!! you wroth a subscription!!!!! pass by value and ref got cleared !!!! salute brother

  • @Shahidraj1
    @Shahidraj1 9 років тому +4

    Awesome!!! I like the way you explains!!!!

  • @CaveDave
    @CaveDave 7 років тому +1

    very good explained. thank you

  • @svwentertainment7429
    @svwentertainment7429 6 років тому +1

    Outstanding Superb
    YOu are best teacher in the whole world..

  • @MrRasZee
    @MrRasZee 5 років тому

    got it thanks , i had to watch it multiple times, but when i got it ....i got it....thanks again

  • @denistrichet419
    @denistrichet419 5 років тому

    very good course ! probably the best in c#

  • @Itay12353
    @Itay12353 4 роки тому

    very good video thanks dude

  • @imakechannel
    @imakechannel 2 роки тому

    This video is fantastic

  • @dillonisaacstse3924
    @dillonisaacstse3924 7 років тому +1

    Great video. Keep it up! Subb'd.

  • @asadKhan-gl1nf
    @asadKhan-gl1nf 4 роки тому +1

    Love the way you explain, is the next course coming any time soon? @jesse

  • @nodararonia1554
    @nodararonia1554 4 роки тому

    Thanks Jesse!

  • @hacerclic1020
    @hacerclic1020 3 роки тому

    Thanks! This is one of the best explanations I have seen.

  • @nidiot37
    @nidiot37 5 років тому

    I'm actually using Pluralsight to refamiliarise myself with C# and had to come here for clarification on Pass By Reference/Value. Great video, very articulately described. Now to cancel my Pluralsight subscription and follow the rest of your courses!

    • @JesseDietrichson
      @JesseDietrichson  5 років тому +3

      I'm actually planning on making a brand new c# course. I'm just trying to figure out what exactly I want to cover in it. I don't know if I should pick up where I left off in this series, or just start over. The content is pretty old, and I've learned a lot since then in teaching.

    • @nidiot37
      @nidiot37 5 років тому

      It might be more 'aesthetically pleasing' if you were using an newer version of VSCode or something and making use of some of the extensions? Apart from that I guess not a lot changes for the real fundamentals!

    • @shepardunlimited7924
      @shepardunlimited7924 5 років тому +2

      The core content is still relevant and your teaching flow is excellent so may I humbly suggest that there is no need to start over, but to add on.

    • @trackhero2714
      @trackhero2714 4 роки тому

      @@JesseDietrichson your c# course on youtube is way above and beyond anything else available for free or paid . Really fantastic stuff.

    • @Lanthiren
      @Lanthiren Рік тому

      @@JesseDietrichson are you still planning on doing one?

  • @unknownsoul7043
    @unknownsoul7043 3 роки тому

    so anything with a new is a ref, so that means i can remove ref off my new list and object then...thanks

  • @AlhambraDream
    @AlhambraDream 6 років тому +4

    Not all objects created with new are reference types. For example structs are created with new but they are value types... I think you should correct some parts of your tutorial.

  • @ariamis0751
    @ariamis0751 6 років тому

    I know this is an old video, but aren't you passing the array by value as well later on in the video. From what I can understand you're passing a reference variable by value which means if you for example assign a new array to the variable inside the function then the outside array wont be changed at all but if you change the values inside the array as you did then the outside variable will be referencing the changed array as well. Basically what I'm saying is for example if you pass in an array grades with grades[0] = 50 and inside the function if you changes the grades array as grades = new int[1]{100} then when you come out of the function the value of grades[0] will still remain 50 which means you're passing a reference variable by value that is what you're passing is the value of the reference. Please correct me if I'm wrong and I'm sorry if I couldnt convey it properly. Thank You.

    • @ariamis0751
      @ariamis0751 6 років тому

      Also want to link this article if I totally messed up my point jonskeet.uk/csharp/parameters.html. In this what I'm talking about is under the side heading value parameters.

    • @JesseDietrichson
      @JesseDietrichson  6 років тому

      ariamis07 you are 100 percent correct. Everything in csharp is pass by value by default. So here we are passing a reference type by value. The reason I explained it like I did back then is just because I thought it would be easier to understand however I’ve always regretted teaching it like this and if I made this again I would change it.

    • @ariamis0751
      @ariamis0751 6 років тому

      Thanks for the reply, It was kind of confusing at first but I think I understand now.

  • @bedouinangel
    @bedouinangel 4 роки тому

    So the first one didn’t work because it’s a struct, but the second one worked because it’s a class?

  • @milosbojanic725
    @milosbojanic725 4 роки тому +1

    This is not pass by reference. You passed value of reference type, not real adress of that variable.

    • @JesseDietrichson
      @JesseDietrichson  4 роки тому +1

      bojanicm you are 100 percent correct. I think when I made this video I tried to make it easy to understand by describing it that way