29. C# - Delegates

  Рет қаралды 49,292

Ervis Trupja

Ervis Trupja

Күн бұрын

In this video, we'll be talking about delegates in C#. Delegates are a powerful mechanism you can use in your code to improve the readability and performance of your code.
We'll explore how delegates work, and how to use them to simplify your code and make it easier to understand. We'll also look at some common patterns you may encounter when working with delegates, and how to best use them in your code.
#csharp #dotnet #delegates #programming #functions #learn #development #webdev #dev #dotnethow

Пікірлер: 94
@RobertoDeMontecarlo
@RobertoDeMontecarlo 5 жыл бұрын
One of the best explanations about Delegates I ever watched... Thanks!
@DotNetHow
@DotNetHow 5 жыл бұрын
Thank you for watching
@ecerejo
@ecerejo 4 жыл бұрын
5 minutes of pure simplicity is all it took to get rid of all my confusion about this subject. A big THANK YOU.
@DotNetHow
@DotNetHow 4 жыл бұрын
Thank you!
@patrevizani
@patrevizani 3 жыл бұрын
omfg, just watched 5 or 6 videos on delegates, found this to be the best one, not just for the explanation, but mainly due to the good exemples on how to actually use. thanks a lot!
@DotNetHow
@DotNetHow 3 жыл бұрын
Thanks for the feedback. I am glad you liked it.
@redblade79x
@redblade79x 2 жыл бұрын
Thank you! I just spent the last 2 hours trying to wrap my head around delegates and you explained it perfectly within 5 minutes. Amazing!
@DotNetHow
@DotNetHow 2 жыл бұрын
You are welcome. I am glad you liked them
@niko6646
@niko6646 5 жыл бұрын
spent a hours on this and finally got it 3 mins into your video. thank you sir
@DotNetHow
@DotNetHow 5 жыл бұрын
You are welcome. I am glad you found it useful!
@DotNetHow
@DotNetHow Жыл бұрын
I'm glad the video was helpful to you!
@faithyintii8457
@faithyintii8457 5 жыл бұрын
I like how your videos are short and straight to the point... thanks man
@DotNetHow
@DotNetHow 5 жыл бұрын
Thanks for your feedback
@anomalii7720
@anomalii7720 4 жыл бұрын
Delegates are like managers: nobody needs them.
@psycho.2u
@psycho.2u 4 жыл бұрын
You can't call a private method in another class directly. But by using delegate, you can..
@jopsthegamer1975
@jopsthegamer1975 4 жыл бұрын
@@psycho.2u You're right. Also delegates are really important in asynchronous programming(Threading)
@DotNetHow
@DotNetHow 4 жыл бұрын
Thanks Raj
@DotNetHow
@DotNetHow 4 жыл бұрын
Thanks for the update
@anomalii7720
@anomalii7720 4 жыл бұрын
@@psycho.2u That is not why it is private.
@thibno8260
@thibno8260 Жыл бұрын
Your tutorial put an end to my 2-hour wandering on the Internet looking for the meaning of "delegate" in C# !
@palesarapapali1698
@palesarapapali1698 10 ай бұрын
thank you for making this topic simple to understand, i struggled a lot trying to understand delegates. This was very helpful
@DotNetHow
@DotNetHow 10 ай бұрын
Thank you
@glu_max
@glu_max 3 жыл бұрын
The only bad thing about this video is inappropriately loud music. Other than that - great job, thank you!
@0xF81
@0xF81 2 жыл бұрын
Yeah, there could be even no music at all
@iswilson
@iswilson 9 ай бұрын
Simple and easy to understand. Thank you very much
@DotNetHow
@DotNetHow 9 ай бұрын
Thank you for watching
@Oom_Sakkie
@Oom_Sakkie 3 жыл бұрын
Good quality programming tutorials make granddaddy's prostate feel alive again
@andrewqolta9642
@andrewqolta9642 4 жыл бұрын
I have never understood this delegate concept before. Now I got it. thank you.
@DotNetHow
@DotNetHow 4 жыл бұрын
You are welcome
@fredyuldashev
@fredyuldashev 4 жыл бұрын
Dude, i watched the top instructors on youtube..inlcuding Mosh, Tim Corey you fucking name it...they all confused the fuck out of me, yet your video is only 5 minutes and it was sooooo CLEAR!
@DotNetHow
@DotNetHow 4 жыл бұрын
Thank you for your feedback, Fred! I am glad I was able to help! :)
@SK_TnT
@SK_TnT 2 жыл бұрын
great.. nicely explained in simple way & short time
@DotNetHow
@DotNetHow 2 жыл бұрын
Thank you
@antalsergiu7649
@antalsergiu7649 5 жыл бұрын
Very clear explanation, thanks a lot !
@DotNetHow
@DotNetHow 5 жыл бұрын
You are welcome
@SWIFTzTrigger
@SWIFTzTrigger 2 жыл бұрын
What a brilliant explanation, thank you
@ismetince
@ismetince 4 жыл бұрын
The best explanation. Thank you
@DotNetHow
@DotNetHow 4 жыл бұрын
Thank you!
@fulgencejuniorlohore854
@fulgencejuniorlohore854 7 ай бұрын
Thank you for this great tutorial!
@DotNetHow
@DotNetHow 7 ай бұрын
Thanks for watching
@imadabab
@imadabab 11 ай бұрын
Thanks a lot for the great explanation. In other words, a delegate is a variable of type method, and this variable can be a parameter in another method.
@DotNetHow
@DotNetHow 11 ай бұрын
True
@imadabab
@imadabab 11 ай бұрын
@@DotNetHow Your explanations are extremely helpful and excellent. Keep it up. Thanks a lot.
@MiledRizk
@MiledRizk 4 ай бұрын
Thanks, this was a clear explanation.
@DotNetHow
@DotNetHow 4 ай бұрын
Thanks a lot for your feedback @MiledRizk!
@Imafriggingoddess
@Imafriggingoddess 2 жыл бұрын
Nicely explained! However, I've yet to understand how delegates can help me in a real life scenario. I've worked as a c# dev for almost 4 years and I've yet to run into a scenario where I thought "A delegate would be great here". Thanks for the video!
@DotNetHow
@DotNetHow 2 жыл бұрын
I just created this blog post which I think would help you better understand Delegates. Check it out and let me know - dotnethow.net/delegates-in-c-sharp-with-examples/
@Imafriggingoddess
@Imafriggingoddess 2 жыл бұрын
@@DotNetHow Amazing, thanks!
@GiSeiNoREI
@GiSeiNoREI Жыл бұрын
​@@DotNetHow I still don't see the usefulness of delegates. One can still call those methods without using the delegate in the multi-casting example. I'll always go for less lines of code. Perhaps an example of code refactoring using delegates would prove their usefulness.
@DotNetHow
@DotNetHow Жыл бұрын
Delegates can be incredibly useful in certain scenarios, especially when it comes to event handling or implementing callbacks. Keep exploring and you might find a situation where delegates can make your life as a C# dev much easier!
@zouken2571
@zouken2571 Жыл бұрын
Very helpful, thanks
@shanmugapriya8562
@shanmugapriya8562 3 жыл бұрын
Thanks for the clear explanation
@DotNetHow
@DotNetHow 3 жыл бұрын
You are welcome
@theprogrammer7837
@theprogrammer7837 4 жыл бұрын
u're a great teacher and this is a fact
@DotNetHow
@DotNetHow 4 жыл бұрын
Thanks Hicham
@Bmaster3234
@Bmaster3234 3 жыл бұрын
You explained this well, but I don't understand why someone would want to use a delegate instead of a plain and simple method
@Twelve.
@Twelve. 3 жыл бұрын
Thank you!!
@Michael-Mosca
@Michael-Mosca 3 ай бұрын
i stopped coding after college for like 4 years and completely forgot delegates existed
@DotNetHow
@DotNetHow 2 ай бұрын
I hope you found this tutorial useful
@efai
@efai 3 жыл бұрын
you can just call ToUpperCase and ToLowerCase methods directly and it will do the same thing.. what's the point here to do this with delegate ? wouldn't be better example, if you would have a second class involved ?
@DotNetHow
@DotNetHow 3 жыл бұрын
Sure, I could have used other examples, but that would be an easy to understand method, so I used that.
@sirishmisthry8462
@sirishmisthry8462 Жыл бұрын
6 months of confusion ended by this video
@DotNetHow
@DotNetHow Жыл бұрын
Glad to hear that 😃
@DavidCoptil
@DavidCoptil 3 жыл бұрын
nice one, but the music is a bit distracting.
@DotNetHow
@DotNetHow 3 жыл бұрын
I agree. I have not used any music in my other tutorials.
@hassanarabahmadi
@hassanarabahmadi 10 ай бұрын
Thank u but if we Add both upper and lower to delegate which one of them will show?😅
@Lanthiren
@Lanthiren 2 жыл бұрын
why is the text lowercase in before in the WriteOutput() method, and then uppercase after?
@lee5150
@lee5150 2 жыл бұрын
No matter how many video I watch on delegates, I don’t not understand them! I can’t even imagine the concept of them. People on a course I’m taking struggled so much with interfaces but I find delegates MUCH more confusing!
@xanh.9999
@xanh.9999 6 ай бұрын
thank you
@DotNetHow
@DotNetHow 4 ай бұрын
you are welcome
@Ramboo339
@Ramboo339 4 жыл бұрын
Never seen .Invoke before, how does that work? Most examples I see use callbacks
@arkanglegeibriel
@arkanglegeibriel 3 жыл бұрын
note: the "delegate" keyword is never mentioned.
@Iam_inevitabIe
@Iam_inevitabIe Жыл бұрын
Don't get what u mean here chief
@kiPROBRos
@kiPROBRos 3 жыл бұрын
Excelent.
@DotNetHow
@DotNetHow 3 жыл бұрын
Thanks
@perelium-x
@perelium-x 3 жыл бұрын
Is delegate a begginner or intermediate or adv??
@Cleax21
@Cleax21 2 жыл бұрын
Intermediate / advanced.
@DotNetHow
@DotNetHow 2 жыл бұрын
Correct
@MirAnupamHossainAkib--
@MirAnupamHossainAkib-- Жыл бұрын
thanks
@DotNetHow
@DotNetHow Жыл бұрын
You're welcome!
@nimecloud
@nimecloud 2 жыл бұрын
At the end I know what delegate is in C#
@RyantheCanuckpirate
@RyantheCanuckpirate 2 жыл бұрын
This is a great video (and maybe it's just me) but the loud music during the video is really distracting. It's competing with your voice for my attention, which I find counterproductive
@sonnyobrien
@sonnyobrien Жыл бұрын
what is a parameter
@DotNetHow
@DotNetHow Жыл бұрын
A value that gets passed to a method
@sonnyobrien
@sonnyobrien Жыл бұрын
@@DotNetHow what?! But what is a method?
@alexhawkins5486
@alexhawkins5486 Жыл бұрын
@@sonnyobrien a method is a function
@sonnyobrien
@sonnyobrien Жыл бұрын
@@alexhawkins5486 why not just call it a function?
@GiSeiNoREI
@GiSeiNoREI Жыл бұрын
You forgot to explain why are delegates useful. In your example they're not. It's just additional code without benefits.
@regular-user
@regular-user Жыл бұрын
Maybe I'm too stupid or these tutorials just don't help. Here is the problem... why use delegates when the function itself could simply be placed in there and it would do the exact same thing? I'd love to see real life examples of when delegates are more useful than not. What you just did there can also be done by just placing the methods in Main, so why use a delegate at all? 🤷‍♂️
@Dismanameboi
@Dismanameboi 10 ай бұрын
I think it’s so you can pass a function into a method
@oskarkarlsson4707
@oskarkarlsson4707 Жыл бұрын
please stop music
30. C# - Event
5:18
Ervis Trupja
Рет қаралды 17 М.
C# Delegates & Lambdas Explained
32:43
Raw Coding
Рет қаралды 39 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
C# Events and Delegates Made Simple | Mosh
32:04
Programming with Mosh
Рет қаралды 959 М.
Delegates in C# - A practical demonstration, including Action and Func
1:09:11
C# Events & Delegates
17:21
Tarodev
Рет қаралды 93 М.
C# Delegates explained
8:47
.NET Interview Preparation videos
Рет қаралды 519 М.
What are Delegates? (C# Basics, Lambda, Action, Func)
18:39
Code Monkey
Рет қаралды 308 М.
27. C# - Indexers
3:59
Ervis Trupja
Рет қаралды 15 М.
What is a C# Delegate and how does it help my code? + Example
17:54
This TEMU Apple Watch has AIRPODS inside… 🤔
11:15
Smokin' Silicon
Рет қаралды 719
C# generics ⁉️
5:33
Bro Code
Рет қаралды 85 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН