C# Delegates explained

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

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

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

    Do not miss our Interview Question video series
    30 Important C# Interview Questions : th-cam.com/video/BKynEBPqiIM/w-d-xo.html
    25 Important ASP.NET Interview Questions : th-cam.com/video/pXmMdmJUC0g/w-d-xo.html
    25 Angular Interview Questions : th-cam.com/video/-jeoyDJDsSM/w-d-xo.html
    5 MSBI Interview Questions : th-cam.com/video/5E815aXAwYQ/w-d-xo.html

  • @mrbananaman8032
    @mrbananaman8032 4 ปีที่แล้ว +96

    Thank you for clarifying the "WHY" right away and calling out how stupid delegates seem at first glance.
    In other tutorials that just start teaching you how to use them I can't concentrate and learn because I'm waiting for the actual reason you'd want to use them in a real situation the entire time.

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

      Yeah that's really missing sometimes

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

      How can you soooo ME! this is exactly what I was thinking!

  • @DGangstaVEVO
    @DGangstaVEVO 9 ปีที่แล้ว +211

    Every tutorial i've watched made me think delegates are very complicated until i've watched this and it became so simple! You are awesome, i love the way you teach!

    • @BeLogicalAlways
      @BeLogicalAlways 6 ปีที่แล้ว +8

      Not that great

    • @lica281
      @lica281 4 ปีที่แล้ว

      Came here just to say this. Bravo. Fantastic explanation.

    • @MrGramatix
      @MrGramatix 4 ปีที่แล้ว

      Yes very true, I read many tutorials and watched few videos too but he explained very well in a simple manner

    • @maxron6514
      @maxron6514 4 ปีที่แล้ว

      Yes very well explained

    • @alagarswamyingersoll
      @alagarswamyingersoll 4 ปีที่แล้ว

      True.I feel the same.

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

    The biggest question for me when hearing about Delegates in the first day was "Okay, but why? This seems awfully complicated to do something massively roundabout", and thankfully you solved that in the first minute! Many thanks for the wonderful explanation :)

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

    I watched an 90 minute tutorial on Delegates yesterday, but couldn't really understand why they looked strange and what I might use them for. Less than 9 minutes here and its clear. Thank you!

  • @scottcase6195
    @scottcase6195 7 ปีที่แล้ว +1

    I appreciate that you talked about the reasons why to use delegates. Most videos I have found on this topic just go directly to code and show how to use the delegate with no attempt to explain why, or what it's doing or how it fits in. It's a difficult concept to get clarity on, and a lot of TH-camrs don't seem to really know how it works or why; they just know how to make it work without really understanding.

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

    Indian accent? Yes
    Less than ten minutes? Yes
    6 years old? Yes
    Great explanation? Yes
    Dunno where this comment going anymore? Yes
    *This video is a legend.*

  • @permindersingh1216
    @permindersingh1216 5 ปีที่แล้ว +9

    Just adding to what you said, delegates can also be used to invoke function asynchronously on a separate thread using BeginInvoke

  • @anshubudhiraja
    @anshubudhiraja 7 ปีที่แล้ว +4

    I don't think that it is only about callbacks. In C# 7, you can pass a method as a parameter, without using delegate, so according to you these delegates should have been removed from C# 7, but delegates have one more, more important role to play and that is to use it for events.

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

    You just got an extra subscribers. Succinctly explained. Not assuming and talking about the why. It is missing in most videos. Most people assume that the point will be gotten from just the simple but "stupid" definition. Thank you for going the extra mile to explain the why...very important and much appreciated.

  • @prashantb9771
    @prashantb9771 8 ปีที่แล้ว +158

    screen should have less zoomed so everything could have been displayed in one page

    • @drianlarde
      @drianlarde 4 ปีที่แล้ว

      this is so true..

  • @RedBirdOBX
    @RedBirdOBX 7 ปีที่แล้ว

    Thank you. This is the first video to explain not HOW to use one....but WHY you could use one. Thanks again.

  • @colinrickels201
    @colinrickels201 5 ปีที่แล้ว

    Your accent is more crisp then any teacher i know. Very easy to listen to and comprehend. Keep up the good tutorials !

  • @DineshKumar-lq2ck
    @DineshKumar-lq2ck 3 ปีที่แล้ว

    Nothing is difficult you have the right Teacher. You are the one.

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

    Another Indian bro pulling us all up here. Thanks so much!

  • @Someone-jf3mb
    @Someone-jf3mb 7 ปีที่แล้ว +25

    So basically, what he is trying to say for this 8 mins long video is you can call functions from a different class (Scopes), which can be use to call back.
    Let's say there are two classes A and B.
    A calls a method in B class.
    if the method in B wants to tell A some data, it can't unless with delegate.
    With delegate:
    A calls a method in B class which has a delegate.
    A needs to specific what functions in A that B wants to call.
    B passes in data or just call the delegate (function in A)
    Please correct me if I am wrong. Hope this helps anyone.

    • @rupeshkamble9105
      @rupeshkamble9105 7 ปีที่แล้ว +1

      Steve Lo thanks.. you explained it very well..

    • @rabinzx
      @rabinzx 6 ปีที่แล้ว +1

      thank you. I was still lost after watching the video, but you sorted things out for me. So delegate has no use under the same class, right?

    • @unskeptable
      @unskeptable 5 ปีที่แล้ว +1

      Some one broken english sorry

  • @BahawalTV
    @BahawalTV 5 ปีที่แล้ว +1

    Most of videos does not explain the real NEED of delegates.
    Delegates provide ability to pass METHODS as PARAMETERS to other METHODS. So that other methods can execute them. In Javascript functions are objects. So passing a function as parameter to other methods is not a problem.
    But in C#, you must add the function reference to a delegate object, and then it can be passed to another method, which can execute it as and when needed. Most popular use of delegates is in implementing callback methods or event handlers. C# EVENTS use delegate internally to implement events and event handlers.
    The PUBLISHER class declares a delegate, and then an event which uses the delegate internally. Then raises the event as and when needed.
    The SUBSCRIBER class subscribes to the event of publisher. Internally, it just adds the EventHandler method reference to the delegate of SUBSCRIBER. That is the whole story.

  • @sasiskitchen9566
    @sasiskitchen9566 6 ปีที่แล้ว +1

    In simple words, if you have a thread running and you want to access the other thread method you can use delegate. Cross threading can be performed using delegate. Communicate between two foreign threads. That’s it. Have two threads running and try to access the other thread method, which will end up in cross threading error in runtime. Now use delegate and invoke that method. Wow it’s running.

  • @dlmaher1959
    @dlmaher1959 3 ปีที่แล้ว +6

    Excellent !!!
    Very concise, clear explanation. This the second of your tutorials I have followed, first was threading.
    Just some general feedback; maybe in your examples you should use real world "objects" when discussing classes and functions. So instead of just "obj", use something like "ACUnit". This has real world context that makes it easier for people to follow your examples. Each AC has properties and methods that u can call
    I think it makes teaching easier

  • @ThePGloor
    @ThePGloor 8 ปีที่แล้ว +1

    I'm not new to delegates, but found this presentation very useful when I've been looking for a way to explain delegates to others. After watching your video explaining delegates has become easy and meaningful. Thank you!

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

    Finally!!! I always thought delegates were a very stupid concept because i never understood the point of using this, but this is the first video that i find correctly explains them and gives a practical example of them.

  • @rongreen3648
    @rongreen3648 6 ปีที่แล้ว

    Nice explanation showing that a delegate is more than just a simple function pointer. It is a communication device, a callback. Good "delegates from India" illustration!

  • @gasstove9437
    @gasstove9437 5 ปีที่แล้ว +40

    need some real time examples to understand this in more proper way.

    • @asagiai4965
      @asagiai4965 4 ปีที่แล้ว +7

      Callbacks * 3
      Though if you don't know callbacks you can look at Javascript it have simple definition that can work in many lang.
      Basically think of delegates as variables that can represents functions. ( As long as it *match the function)
      Example
      Delegate void sample_delegate(); // this delegate matches all functions that are void and have no arguments.
      void say(sample_delegate callme)
      {
      //INVOKE callme
      }
      void hello()
      {
      Console. Writeline("Hello");
      }
      //Now you can make say say hello
      say(new sample_delegate(hello));
      **the very important thing about delegate or callbacks is they are not the functions they are representative of functions*

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

      @@asagiai4965 thanks man this shit was so damn helpful i appreciate it dude

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

      @@sypo_x1891 you're welcome

  • @oorja1983
    @oorja1983 9 ปีที่แล้ว +5

    good basic kick start but it would be great if you make more videos on this to explain the real power power of delegates when we talk about loosely coupled systems or Event Broker or Observer kind of pattern and that will help the community.
    Thank you making this video and wish to see your more.

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

    Thank you!! I’ve been searching for forever for a decent explanation of delegates. You made it clear and simple to understand in this video. 🙏

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

    What a great explanation! The easiest teaching means the huge number of study in the background!

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

    Best delegate video for understanding the REAL purpose of delegates. Thank you!

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

    Because the definitions that I was given, "a ptr to a function" I have had a really hard time getting it. Thank you brother, you hit the nail on the head. Or maybe into 'my head'... I get it now!!!
    Thanks.

  • @akshaytalekar2880
    @akshaytalekar2880 6 ปีที่แล้ว

    You Made Delegates Simplest. This is the Great Understandable Explanation Ever I Have Seen.

  • @alagarswamyingersoll
    @alagarswamyingersoll 4 ปีที่แล้ว

    Excellent explanation sir.I appreciate it.I have been searching to know why we use delegates in C#,now,I have the answer for it.Thank you sir.

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

    This is the best explanation of delegates I've seen

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

    Very clear and concise way of explaining it. Thank you very much

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

    I didn't like the fact that this video had images placed in a very weird way, In some parts, it was not possible to see the content because it was blocked by the images.
    Also, It didn't show the whole code at once just because he had it zoomed in.
    BUT, this is the only video that got to the point firsthand. So 7/10. good job!

  • @angel_machariel
    @angel_machariel 9 ปีที่แล้ว

    This was a crisp and clear presentation of the essence of the delegate keyword.

  • @x12624
    @x12624 4 ปีที่แล้ว

    I liked the way he explained it, literal explanation of the delegate and finally the callback function example. It made a little more sense now.

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

    Absolute plain and simple! The first video, when I got ann explaination why should I use a delegate.

  • @pramodkumarw
    @pramodkumarw 5 ปีที่แล้ว

    hey shiv ji,you told that i is used for callback ,callback and callback.but can you my below example
    public List FindAll(Predicate match);
    FindAll method is present in List that takes predicate delegate.but i think that is not used for callback.it is used to provides decouple our logic to filter item.please correct me if am wrong and also tell me what is used of predicate delegate .it is used for callback or something else

  • @robertmasterofpain6863
    @robertmasterofpain6863 8 ปีที่แล้ว +16

    Very clear explanation. I've finally got it!

  • @fredyuldashev
    @fredyuldashev 4 ปีที่แล้ว

    I'll be honest? This got my very close to understanding! Good Job!

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

    It's a feature of comparisons that they fall short _somewhere_ but if I'm right the comparison of delegates as a language construct to real-world delegates lacks an essential property of the idea behind them.
    Don't get me wrong - I think this explanation is worthwile, but it is important to know its limitations too. As I see it, the _function_ of C# delegates is indeed similar to that of (country) delegates (i.e. to communicate between two parties). However, an important property of C# delegates is that they are generic, whereas delegates in the real world are _specific_ entities (persons).

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

    Thank you! This is the first video or any material I'm looking about delegates and I can't believe I'm 100% clear, Keep up the great work! :)

  • @shaziahussain3029
    @shaziahussain3029 7 ปีที่แล้ว +1

    Thanks now i learned that a delegate can communicate between two classes or functions and update the data into the functions of classes or between functions as a pointer to the function.

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

    This is the best explanation I have seen. Thank you. 👍👍

  • @MrGramatix
    @MrGramatix 4 ปีที่แล้ว

    Thanks very much for your simple explanation about delegates

  • @rmarikar1
    @rmarikar1 4 ปีที่แล้ว +1

    The BEST explanation of delegates. Thank you.

  • @minelove789
    @minelove789 7 ปีที่แล้ว +17

    I am a Nepali delegate to India :)

  • @sureshmuttagi4380
    @sureshmuttagi4380 8 ปีที่แล้ว +6

    Nice explanation but in this example we can directly call the method "CallBack(int i)"
    like "Program.CallBack(i)" within for loop. Why we need to use Delegate stuff..... Please correct if I am wrong. Thanks in advance.

    • @sharadpatil6916
      @sharadpatil6916 6 ปีที่แล้ว +1

      If we call CallBack function directly then it will wait for end of LongRunning loop. Delegate display information to UI what exactly going on to back end.

    • @dnfvideo
      @dnfvideo  6 ปีที่แล้ว +1

      What if MyClass is consumed in ASP.NET MVC UI. It will display in console and data will never be passed back to the caller. The goal is not to display in console , its communication between two entities.

    • @etbilu6265
      @etbilu6265 5 ปีที่แล้ว

      why wait loop end ??????please answer me "!!!@@sharadpatil6916

  • @kristinadanileviciute4750
    @kristinadanileviciute4750 6 ปีที่แล้ว

    You create a base class FOO, and another subclass BAR that inherits from base class . Also you have some another class FUU {public int FUUproperty{get;set;}=0;} with some property. BAR cannot inherit from multiple classes so declare protected FUU testFUU=new FUU() in base class. Create methods in base class: GetFUUstuff(){ console.write(testFUU.FUUproperty)} SetFUUstuff(int myval){testFUU.FUUproperty=myval} . Create object for FOO and for BAR in Main(). those objects of type FOO and BAR both can call GetFUUstuff() and will receive whats inside that FUU so GetFUUstuff and SetFUUstuff are the Delegate Methods

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

    It would be nice if you showed your full code at the end! Edit: Although I don't think this is sufficient for my use case anyway. You're talking about callbacks, callbacks and callbacks, but I need to use a delegate because I'm working on different threads.

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

    You are easily the best teacher 😊

  • @rajeevjha3714
    @rajeevjha3714 6 ปีที่แล้ว

    clearly explained basically using delegate we can also pass method as a parameter. thanks a lot.

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

    Fancy terms brings more confusion. Plain English, what delegate means, "US delegate to India" right away creates a real-life picture everyone understands. Best!!!

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

    This was the first explanation I had heard that made sense to me. Thank you!

  • @bruinflight
    @bruinflight 4 ปีที่แล้ว +6

    This is a great tutorial thank you!
    And now I will look for the purpose of delegates in He-Sharp :-)

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

    I still don't see why you had to use a delegate. Couldn't you just reference the other classes method directly?

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

      Now you can Separate Code - MyClass from the main Code - Program and Give MyClass to other Developers and they can modify it without making changes to the Main Code.
      It makes code loosely coupled.

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

      Now you can Separate Code - MyClass from the main Code - Program and Give MyClass to other Developers and they can modify it without making changes to the Main Code.
      It makes code loosely coupled.

  • @TamilistTheGamer
    @TamilistTheGamer 8 ปีที่แล้ว

    It took me a while to understand delegates, but now it seems to be clicking. Thanks :D

  • @programuoki-lt1465
    @programuoki-lt1465 2 ปีที่แล้ว

    Feel the same style as Java JDK 1.8 Functional lib with Interfaces, Combining with Lamdas you able to have more generic methods and pass any function like 2+2, 2*2, 2/2 and so on. BTW Delegate word translation is to delegate Job to other or Out sourcing Job :)

  • @eltondaries1215
    @eltondaries1215 4 ปีที่แล้ว

    Very simple and effective explanation

  • @menspa2471
    @menspa2471 6 ปีที่แล้ว +1

    The best explanation ever. Simple and clear

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

    He's certainly right that delegates are used for callbacks... but that's not their only purpose. They're embedded in events, which are a specific kind of callback setup. They can also be multi-cast, so that multiple functions can be called from one delegate invoke, via the + (and - to remove) operator.
    But the big usage of delegates that's not a mere variant on the callback notion is that delegates serve to ABSTRACT and DECOUPLE code. When you pass a delegate into a routine, you're telling the routine that the delegate will do something - potentially taking in some parameters, and potentially returning some values - but hide from the invoking routine precisely exactly what the delegate is doing. Consider, for example, a delegate to display the results of whatever computation was performed. If you pass a routine a DisplayResults delegate, the routine will invoke it without needing to know what exactly it's doing - maybe it's displaying to the console, maybe it's updating a webpage, maybe it's sending the results to a printer - the invoking routine doesn't know and doesn't care when it calls *_displayResults.Invoke(valuesToDisplay);_* .
    This is SOLID programming when the invoking routine shouldn't responsible for knowing about how the results are displayed - only that the results are somehow being displayed (SOLID-S). It's made the invoking routine open for extension, but closed for modification (SOLID-O), i.e., you can change HOW the results are displayed without changing a single line of code WITHIN the invoking routine (so no recompilation & redistribution of the invoking routine is required). Displaying the results is also often a lower level detail than invoking routine should care about, so this is can be a form of dependency inversion (SOLID-D). Although not an interface, delegates can also serve a purpose similar to that of SOLID's Interface Segregation Principle (SOLID-I), in the sense that, when passing a delegate to a routine, you're handing that routine precisely what it needs to do its job - no more and no less. If you passed the routine an entire object, you'd be giving that routine access to all of that object's available properties and methods, most of which the routine probably doesn't need (and as well as, potentially, additional coupling that isn't needed). So either directly or in spirit, delegates can serve to implement 4 of the 5 SOLID principles.
    There's more to be said, but they're mostly consequences of the above. As a consequence of abstraction and decoupling, delegates are invaluable when unit testing. Because delegates are "handing functionality around", they promote composition in general, and even object immutability by handing their abstracted functionality into an object's constructor.
    Bottom line, by using delegates, the invoking routine is decoupled from the implementation details of how the invoked delegate actually does its work.

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

    AWESOME video ! Im programming since 15 Years but nobody could tell me the real BENEFIT of using complex delegate-syntax instead of simple method calling but this callback thing makes totally sense :) But if getting updates while a method is processing, why they are using so often delegates in simple getter and setter? Why you should have an real time update inside a getter especially when nothing is "returned" while getting the value, except the final return at the end? Are Delegates slower the more "communication" is happening between caller and method? I mean in relation to a "normal" implemented method that simply outputs the counter inside the loop.

  • @AkshayPatil-lm2ps
    @AkshayPatil-lm2ps 8 ปีที่แล้ว +13

    Perfectly explained. it was confusing Thanks.

  • @jmora7101
    @jmora7101 4 ปีที่แล้ว

    ok you got the point. but delegate is a class pointer to a function that can you use to implement callback.

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

    Really good video. Just one request, could you please zoom out at the end and show all the code?

  • @ASML-Veldhoven
    @ASML-Veldhoven 13 วันที่ผ่านมา

    Best explanation so far.

  • @KamilKubiak96
    @KamilKubiak96 7 ปีที่แล้ว

    This is the best and most human like explanation I could find. I got the concept now, thank you so much!

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

    really thanks a lot sir , I thought delegates re really tough to understand but now its easy with this video

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

    Now i got the actually use of delegate, They are so powerful.

  • @logictech6228
    @logictech6228 6 ปีที่แล้ว

    at last I understood what is delegate ..Thank you.. demonstrations should be like this. I've subscribed your Chanel

  • @korukondamehervihari7025
    @korukondamehervihari7025 4 ปีที่แล้ว

    Very good explanation. Thank you so much. Thank you so much. Thank you so much.!

  • @TheChodex
    @TheChodex 5 ปีที่แล้ว

    Thanks for very clear explanation of delegate. The way you explained the origins of delegate in English dictionary was very helpful.

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

    Nice. You also can call delegate via event so that event can be subscribed and its output can be utilized on client side.

  • @joesmith1922
    @joesmith1922 7 ปีที่แล้ว

    Brilliant! I finally see what a delegate is used for. Thanks!

  • @kekistaniattackhelicopter2242
    @kekistaniattackhelicopter2242 6 ปีที่แล้ว +1

    Finally a clear explanation.

  • @KingTornado
    @KingTornado 6 ปีที่แล้ว

    Excellent explanation . Now i understand why we need delegates.

  • @harish0555
    @harish0555 8 ปีที่แล้ว

    Thanq very much loved the expilination and the way of using the Delegate ... Kudaoos ...

  • @GBUKMilo
    @GBUKMilo 16 วันที่ผ่านมา

    Really good explanation. I came here to hear this.

  • @raymondfinton3177
    @raymondfinton3177 4 ปีที่แล้ว

    Nice explanation and very quick. Just what I needed. Thank you.

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

    Simply excellent teaching of how delegates work. Thank you very much.

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

    Very useful, perfect explanation

  • @HemanthHemu
    @HemanthHemu 8 ปีที่แล้ว +18

    Totally confused
    1.U have used the same object name 'obj' for MyClass and CallBack,
    2.C# isCaseSENSITIVE so CallBack and Callback are different,
    3.Although the signature(return type void and parameter int i) of CallBack(delegate) matches with that of Callback(method), the method was never bound to the delgate directly in the code.
    So how is the control flow going on ...?? Which method is getting called..??
    Clarify Please..
    Thanks

    • @asrowley1
      @asrowley1 6 ปีที่แล้ว

      I had the same issues... have you figured this out?

    • @prashanthvunnam6243
      @prashanthvunnam6243 6 ปีที่แล้ว

      There is no confusion you have to learn what is call back functionality

    • @prashanthvunnam6243
      @prashanthvunnam6243 6 ปีที่แล้ว

      Step1 he created delegate
      Step2 he is used that delegate in other running method .in that method that delegate call back with I
      Step3 Main he created another method which takes int I similar syntax of delegate and assigned that method to delegate

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

    Brilliant explanation. Thank you.

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

    Excellent explanation of Delegates. Thanks!

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

    Nicely explained... Great job

  • @subhraswarup
    @subhraswarup 6 ปีที่แล้ว

    The best explanation of delegates ever. Thanks

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

    Excellent explanation. Thanks a lot. I have subscribed.

  • @sarmistharay5921
    @sarmistharay5921 5 ปีที่แล้ว +1

    Great... Explanation Sir.Thank you so very much.

  • @zebasxx
    @zebasxx 6 ปีที่แล้ว

    thanks for the video, I really appreciate when some one spend time trying to share knowledge. Despite that, I would advice you to show the full code and smaller text, I got lost in your explanation because for the big text.... got me crazy.

  • @sashikumar313
    @sashikumar313 6 ปีที่แล้ว +1

    iam little confused pls correct me we can directly call a method right like--
    public void Longrunningmethod()
    {
    for(int i=0;i

  • @bot0656
    @bot0656 9 ปีที่แล้ว +4

    Great explanation but there is something missing here. May be we need to explain call back moreSo is it the the callback function can be from main thread and the actual class is executed in a background thread. By passing callback from main thread, we can actually update the front end GUI. Otherwise we wont be able to do so with no callbacks
    - via YTPak(.com)

  • @stevebuddy6827
    @stevebuddy6827 8 ปีที่แล้ว +1

    Teach me more please!!! I love your style of teaching! :)

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

    Thank you for the great explanations

  • @taskinkhaleque2100
    @taskinkhaleque2100 9 ปีที่แล้ว

    simple and clear presentation.

  • @itsmeafridi
    @itsmeafridi 8 ปีที่แล้ว

    Read a few of the books but i found this one very well explained.

  • @finalGuessing
    @finalGuessing 7 ปีที่แล้ว

    I'm game developer I think delegate are very useful for something like this.
    void printThisWithFunc(System.Action PrintStuffFunc, int someParameter){
    var thingtoprint = "";
    /// do something very long with those parameter.
    ///
    PrintStuffFunc(thingtoprint);
    }
    /Then let assume we in Unity
    private void Start(){
    printThisWithFunc(print, 200);
    printThisWithFunc(Debug.Log, 200);
    printThisWithFunc(System.Console.WriteLine, 200);
    }
    If you mix and match with some OOP stuff you can done some tricky stuff very productive and readable.

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

    Nice tutorial.Good job!

  • @electrocatalyst
    @electrocatalyst 6 ปีที่แล้ว +44

    It's so funny that you pronounce C-Sharp as shisha :D

    • @ahmedfayyad9696
      @ahmedfayyad9696 4 ปีที่แล้ว +1

      yeah :D i think so

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

      Anybody else felt like smoking a bong? 🤣

  • @HaiNguyen-vu9cj
    @HaiNguyen-vu9cj 3 ปีที่แล้ว

    Thank you very much. This is a very good sample.

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

    You are awesome, i love the way you teach!

  • @SD-gj2by
    @SD-gj2by 6 ปีที่แล้ว +1

    Awesome explanation and video. Totally get it! Thankyou