I never comment on videos. But I really couldn't get my head around Generics. And watching this video really helped. It all became clear 3 mins in and I still watched it to the end! Appreciate the video and the excellent examples, thank you!
I'm new to coding - in general, not only in c#. And you're definitively my teacher - you know what you are talking about. What impresses me the most is that you have obviously some sort of didactics to your thematics. Highly appreciate that! Keep doin vids, they're awesome!
This guy is an absolute master when it comes to passing the knowledge on to others. I highly recommend to check his tuts anywhere (I've been watching C# tuts only so far). Mind that some of the more complex ones might take a 2 or 3 reviews to fully get, cause they're... well about complex subjects... But all of the details are there.
Very clear, concise and thorough. Thanks a lot. I like how you narrate what the code / symbols mean - that really helps a lot. That is one thing that for me makes C# a real pain - that it is not easy to read at all because instead of words it uses e.g ":" or "#" to mean something. Apart form being difficult to read, you cannot exactly Google : in C# and find out what it is doing.
just bought all your C# courses on udemy fundamentals, OOP, and advanced. Thank you so much. honestly the only confusing thing about your courses is how well you explain concepts.
Really Good Just Saw your Video i did not see fully i saw little bit because i am in office so i did not see i see in my Home. You are are a Good Teacher
Dear Mosh, I am new to c#, and i understood the using generics but still confused about constraints..... i see that using generics is good to create a generic class, But adding constraints , just makes it not generic " that's what i get " in this case what is the difference between the below 2 styles ( with and without generics ) Method1: -------------- class Constraints where TBook : Book { public void FirstMethod(TBook book) { } } Method1: -------------- class Contraints21 { public void FirstMethod(Book book) { } }
don't use the word abstraction if you're a beginner please, it's pretentious. Haha just messin' with you, yeah sometimes you go through the basics and you think you're all fine and dandy with classes, methods, variables, if statements, for statements and all that jazz. But then you come across the next video and it's all crazy =shit bet.you(didn't think you(could do this));
I got examination from home in c# this week. Been trying to use objects, but that didnt work as planned. So I think generics is what I need, you also explain the exakt setup I need for this :).
Lets say i am doing a generic class call it Node. In only one method i would like that T be Node. So if we look at Node it would be Node... i am quite new... So how can i do it? I believe that Node is list. And is has property named: T data.
Beautiful tutorial really love it, if i may ask what is the theme you are using on visual studio?. Really like it will love if you could share that am new to the visual studio environment.
Isnt the discount calculator supposed to be just a method that takes an Product as a parameter? It does not need to be generic. Am I missing something?
+Programming with Mosh I've followed the advanced tutorial on Udemy, it's really good, so i decided to follow the intermediate too even if i've read books and blogs about classes, OOP & co., i will leave a reviews for both at the end of the intermediate one. For now, u did a very nice job! About ICommand, i think that the annoying part is related in all that concerns concept of mvvm! Would appreciate a nice video/blog or a udemy lesson on it! I didn't know if u should use it on your own work in ASP:net, but it's a main concept in WPF and in the iOS application (objectiveC)
why is it that in c# we are force to set the datatype in our variables eg. string, int, bool etc. but also allows us to use generics. Why is that? I thought c# is a strong-type language.
Hello Mosh, when we apply constraint class to a generic say " public class DiscoutCalculator where TProduct : Product " is same as saying " public class DiscountCalculator " ?
You're not alone. Mosh has a tendency to zoom through presentations without explaining anything. #1 rule of teaching, NEVER just take for granted that your students "get it." You must explain in painstaking detail. But not Mosh. I've already watched the first 2 minutes FIVE times and I still don't understand what he's even trying to solve. Explanations are above him, you see. He just throws the line "public Book this [int index]" out there, completely oblivious to the fact that there may be people who don't understand that syntax. "What do you mean," says Mosh. "This is so easy I was doing it in nursery school. You must be too stupid for me to have to explain it to you." On average I tend to exit his videos about 11.8% more confused than I went in with. Not good. And for the love of God, do NOT take a class with this charlatan. Never explains anything, never answers student questions, just takes your money and throws you to the wolves. And if that's not enough, makes you buy a $300 per year software that he dogmatically insists is the best thing out there and you're stupid not to use it. I'm willing to bet he's getting a little commission from Resharper, he acts more as their salesman than a teacher.Positively HORRIBLE excuse for an instructor.
@@tomservo75 It is acceptable he does not cover the basics. It is also acceptable where he would not explain anything that is not related to the subject of this video, the Generics. I am here to grasp the Generics; not for example, what "public Book this [int index]" does.
one reason people can't get how Generics work is the lack of scenarios. you may see a good scenario once a year. So you know how it works you just don't have an opportunity to use it.
what function has 'this' on " Book this[int index]"? and I think it would be good to explain what where T : IComparable is, as it does not look like any other code.
+rhubarbcheese This is an indexer. We use that to implement indexers on classes. An example of that is the Array or List class. They have indexers so you can access elements by an index: array[0]
Thank you! Im aware of this now. But it still doesnt explain what exactly it is..! It looks like an extension method a little, doesnt it? And im thinking now that... does it make sence at all, that when I combine those symbols together I make an indexer, or, is it that.... its just how it is. Do you know?
Programming with Mosh really? I found a course on udemy called c# advanced topics and it was taught by someonw who looks like you with the same video type
My problem is that you leave us hanging in some cases, when you create something like a product constraint, you never actually show how it is used then you move on the creating a type new() constructor constraint and now i know how to create these things and what they are but still not clear on their real world application.... I have so much more to lean :-(
Hey, Mosh, how do you get your entire IDE's background black/grey like that? I've tried, but I can only get the window with the code like that, not the other windows.
what does the "this" in "public Book this[int index] mean? I see the word used in so many contexts it's confusing. As for the List class, I'm really confused here. You've already got a class BookList. So why do you need to create an object list, why not just say public List and be bloody done with it? It's working backwards. "I want a variable of type int but first I'm going to create an object and then use generics to make it an int." Huh???? That makes no sense. This whole "Eeeh, don't worry about what data type it is, we'll figure it out later" just seems like VERY bad practice.
Bernát Gyovai Uhm. Not really a mistake as far as i know... I'm using a Dictionary() because i need to store strings, integers and floats in the same "array". But then i need to cast them to store, and i need to cast them to retrieve.... Is this a mistake? Is there another way to do this?
Your videos are good, but this one SUCKED. I think you choose the bad examples. Nobody gonna use generics for lists, for dictionaries and so on. Also other examples was too complicated to see any advantage of generics. AT least for me this video made me wanna avoid generics :) Best example where people could use generics is HTTP requests where you send objects and receive objects via JSON. So you say Http.Get(LicenceNumber); This will send get request and parse received JSON (in our case) to a Car class and will return it. This also very useful for POST requests where you define T with your class and request sender function serializes your class to JSON. This example would be much more useful then examples you showed. They give no additional value in your video IMO.
I never comment on videos.
But I really couldn't get my head around Generics.
And watching this video really helped.
It all became clear 3 mins in and I still watched it to the end!
Appreciate the video and the excellent examples, thank you!
I'm new to coding - in general, not only in c#. And you're definitively my teacher - you know what you are talking about. What impresses me the most is that you have obviously some sort of didactics to your thematics. Highly appreciate that! Keep doin vids, they're awesome!
This guy is an absolute master when it comes to passing the knowledge on to others. I highly recommend to check his tuts anywhere (I've been watching C# tuts only so far). Mind that some of the more complex ones might take a 2 or 3 reviews to fully get, cause they're... well about complex subjects... But all of the details are there.
this is only my second video of yours to watch, but I have to say they are very high quality and very well done. keep up the good work and thanks.
Very clear, concise and thorough. Thanks a lot.
I like how you narrate what the code / symbols mean - that really helps a lot.
That is one thing that for me makes C# a real pain - that it is not easy to read at all because instead of words it uses e.g ":" or "#" to mean something. Apart form being difficult to read, you cannot exactly Google : in C# and find out what it is doing.
Thank you, this video was much easier for me to understand than others on UA-cam.
This is the second tutorial you have published that I watched. You're doing a damn good job!
+A Freethinker Thanks!
just bought all your C# courses on udemy fundamentals, OOP, and advanced. Thank you so much. honestly the only confusing thing about your courses is how well you explain concepts.
Best tutorial on generics. Thanks Mosh!
this is sooooooo good even 8 years after, you a G
You're very very very extra ordinary and extremely good. You're the best programming teacher I've ever seen.
0:10 - problem
2:44 - create generic list
6:32 - create generic dictionary
8:49 - constraints
pretty concise video, thank you mosh. now I'll dive into details !
Mosh you are the best instructor i have even studied Thanks a lot .........
Mosh you are an awesome teacher ! like the way you make things so simple to understand!
What a great video! I've seen generics in code but haven't really understand what they were doing until now. Thanks!
Really Good Just Saw your Video i did not see fully i saw little bit because i am in office so i did not see i see in my Home. You are are a Good Teacher
Your a great teacher! Can't wait for the ASP.NET course!
fantastic. perfect for my interview tomorrow!
+Tom Hutch How did the interview go? :)
+Moshfegh Hamedani Got the job. Been there 8 months 😀
Dear Mosh,
I am new to c#, and i understood the using generics but still confused about constraints.....
i see that using generics is good to create a generic class,
But adding constraints , just makes it not generic " that's what i get "
in this case what is the difference between the below 2 styles ( with and without generics )
Method1:
--------------
class Constraints where TBook : Book
{
public void FirstMethod(TBook book)
{
}
}
Method1:
--------------
class Contraints21
{
public void FirstMethod(Book book)
{
}
}
Amazing video ! Please do some video like this for exception handling. Good job!
Daste shoma dard nakone. I was stuck on this concept. Berfarma T. =)
dude you are awesome, I learned about so many little things in things which I found very helpful, Thanks a lot :-)
Clear and concise! Excellent!
This is the perfect video for me. I was so confused about this topic. Everything is clear now. :)
Never mind, i figured it out lol Thanks man, big help!
Hi Mosh, do you have a course dealing with how to use those C# interfaces like IEnumerable, IComparable, etc, in detail and why use them? Thanks
As a beginner to C#, holy hell this is some extreme shit my dude. Everything in your code passes through like 18 levels of abstraction.
don't use the word abstraction if you're a beginner please, it's pretentious. Haha just messin' with you, yeah sometimes you go through the basics and you think you're all fine and dandy with classes, methods, variables, if statements, for statements and all that jazz. But then you come across the next video and it's all
crazy =shit
bet.you(didn't think you(could do this));
Nice sir short and sweet (understandable)
I got examination from home in c# this week. Been trying to use objects, but that didnt work as planned. So I think generics is what I need, you also explain the exakt setup I need for this :).
really good explanations.
Thanks Mosh. Very useful.
Nice and Easy , Thanks
Thank you sir you are a great teacher.
+John Doe Thanks John!
Hi Mosh, I enjoyed watching this nice tutorial. Thank you! Can you please explain why should we use IComparable instead of IComparable?
Love your style - question though @16:13 you state _value is object, why not make that of type T?
Lets say i am doing a generic class call it Node. In only one method i would like that T be Node. So if we look at Node it would be Node... i am quite new...
So how can i do it?
I believe that Node is list. And is has property named: T data.
You've made my life simple, thanks!
Valuable content... Thanks for you hard work making this video and sharing it. Great video !!! Awesome.
You knowledge is unlimited :o, WOW, well done!
Very helpful explanation. Thanks a lot!
salam mosh khubi? chetori? :) i can speak a little bit persian. thanks for your videos. they are awesome. wish the best for you brother.
very cool, many thanks
Great video, thank you!
awesome , you should create video on struct vs Classes , and when to use them
Awesome Teacher Sir ... Your Really Good :)
your videos are really informative..
nice one
Great job. Thanks a lot for this awesome video :)
Thanks for your effort. I will follow you. Thanks
what keyboard do you use? sounds good
Very good tutorial, thanks a lot
Very Good! Thanks
You know your stuff man, awesome (Y)
Beautiful tutorial really love it, if i may ask what is the theme you are using on visual studio?. Really like it will love if you could share that am new to the visual studio environment.
+Japheth Jay Hi Japeth, I'm using the default dark theme in VS 2013. I've also installed ReSharper and it adds some extra colors to the theme.
ReSharper hmmm Don't know how to get that, but will try searching online for it thanks though, cause its the same am using but yours is way more sleek
It's a commercial plugin for VS.
Isnt the discount calculator supposed to be just a method that takes an Product as a parameter? It does not need to be generic. Am I missing something?
What shortcut have you used to search file (program.cs)? [time 3:41]
+Adi TheOrigin ctrl + ,
+Estevan Jantsk I use the same but the control looks different!
+Adi TheOrigin I think that's because he's using another version of visual studio. Here looks different to but the functionality is the same.
+Estevan Jantsk : oh! okay.
well, thanks for your response :)
very very good
you are the man
Thank you for the tutorial.
thank you so much for the tutorial it was really well explained
Mosh excellent tutorial. Thank you! When will you get into C#/XAML in store apps? edit: What do you use as your microphone? Very clear.
***** Nice, looking forward to asp.net mvc course . Thank you for sharing your knowledge
What would happen at runtime if the Type T didn't have a parameterless constructor and we called DoSomething() to instantiate an object of said T?
You should do a tutorial about ICommand interface for WPF, it's annoying like the Events/delegate, i founded that tutorial nice!
+Programming with Mosh I've followed the advanced tutorial on Udemy, it's really good, so i decided to follow the intermediate too even if i've read books and blogs about classes, OOP & co., i will leave a reviews for both at the end of the intermediate one. For now, u did a very nice job!
About ICommand, i think that the annoying part is related in all that concerns concept of mvvm! Would appreciate a nice video/blog or a udemy lesson on it! I didn't know if u should use it on your own work in ASP:net, but it's a main concept in WPF and in the iOS application (objectiveC)
Probably one of the best explanation for Generics, plus very good explanation of piece by piece of Genrics. hanks!
بسیار عالی بود، مردم انقدر این ویدئو های هندی رو دیدم، اصلا قابل فهم نیست لحجشون !!
Brilliant, thank you.
why is it that in c# we are force to set the datatype in our variables eg. string, int, bool etc. but also allows us to use generics. Why is that? I thought c# is a strong-type language.
Hmm. But what if you're building an API with response models? Generics are very useful in wrapping database query values.
Hello Mosh, when we apply constraint class to a generic say
" public class DiscoutCalculator where TProduct : Product "
is same as saying
" public class DiscountCalculator " ?
I can't follow this for some reason. I understand what classes and objects are but I am having trouble understanding this.
You're not alone. Mosh has a tendency to zoom through presentations without explaining anything. #1 rule of teaching, NEVER just take for granted that your students "get it." You must explain in painstaking detail. But not Mosh. I've already watched the first 2 minutes FIVE times and I still don't understand what he's even trying to solve. Explanations are above him, you see. He just throws the line "public Book this [int index]" out there, completely oblivious to the fact that there may be people who don't understand that syntax. "What do you mean," says Mosh. "This is so easy I was doing it in nursery school. You must be too stupid for me to have to explain it to you." On average I tend to exit his videos about 11.8% more confused than I went in with. Not good. And for the love of God, do NOT take a class with this charlatan. Never explains anything, never answers student questions, just takes your money and throws you to the wolves. And if that's not enough, makes you buy a $300 per year software that he dogmatically insists is the best thing out there and you're stupid not to use it. I'm willing to bet he's getting a little commission from Resharper, he acts more as their salesman than a teacher.Positively HORRIBLE excuse for an instructor.
@@tomservo75 It is acceptable he does not cover the basics. It is also acceptable where he would not explain anything that is not related to the subject of this video, the Generics. I am here to grasp the Generics; not for example, what "public Book this [int index]" does.
@@tomservo75 dude if you don't know what basic shit is why are you here? Go back to helloworld beginner tutorials man.
Great.
Thank you!
Veru useful! Thanks.
Thanks!
Excellent
one reason people can't get how Generics work is the lack of scenarios. you may see a good scenario once a year. So you know how it works you just don't have an opportunity to use it.
what function has 'this' on " Book this[int index]"? and I think it would be good to explain what where T : IComparable is, as it does not look like any other code.
+rhubarbcheese This is an indexer. We use that to implement indexers on classes. An example of that is the Array or List class. They have indexers so you can access elements by an index: array[0]
Thank you! Im aware of this now. But it still doesnt explain what exactly it is..! It looks like an extension method a little, doesnt it? And im thinking now that... does it make sence at all, that when I combine those symbols together I make an indexer, or, is it that.... its just how it is. Do you know?
is this the same video from your unity course??
Programming with Mosh really? I found a course on udemy called c# advanced topics and it was taught by someonw who looks like you with the same video type
3:41 How you open find pop-up on 3:41 ?
Thanks you so much
Is it used often?
My problem is that you leave us hanging in some cases, when you create something like a product constraint, you never actually show how it is used then you move on the creating a type new() constructor constraint and now i know how to create these things and what they are but still not clear on their real world application.... I have so much more to lean :-(
Please please please make a tutorial on how to make a windows forms application like a calculator.
12:23 the generics get smaller everytime we go code down 😂😂😂
well explained
Hey, Mosh, how do you get your entire IDE's background black/grey like that? I've tried, but I can only get the window with the code like that, not the other windows.
Oh ok, I see now. Thanks a bunch, it looks much better.
very good
what does the "this" in "public Book this[int index] mean? I see the word used in so many contexts it's confusing.
As for the List class, I'm really confused here. You've already got a class BookList. So why do you need to create an object list, why not just say public List and be bloody done with it? It's working backwards. "I want a variable of type int but first I'm going to create an object and then use generics to make it an int." Huh???? That makes no sense. This whole "Eeeh, don't worry about what data type it is, we'll figure it out later" just seems like VERY bad practice.
Hi Mosh,
Can you please make a video about how to accessing a SQL Server?
@9.20 what is that line called. i cant remember for the life of me.
Int can be nullable int?
2:17 I just made this mistake, and came here accidentally not knowing what "Generics" mean... :3 Shame on me! :D Thank you!
Bernát Gyovai Uhm. Not really a mistake as far as i know... I'm using a Dictionary() because i need to store strings, integers and floats in the same "array". But then i need to cast them to store, and i need to cast them to retrieve.... Is this a mistake? Is there another way to do this?
dam those youtube ads lmao i saw 6 ads while watching the video lmao
lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao lmao.
Their is no audio.
Polymorphism in action
Your videos are good, but this one SUCKED. I think you choose the bad examples. Nobody gonna use generics for lists, for dictionaries and so on. Also other examples was too complicated to see any advantage of generics. AT least for me this video made me wanna avoid generics :)
Best example where people could use generics is HTTP requests where you send objects and receive objects via JSON. So you say Http.Get(LicenceNumber); This will send get request and parse received JSON (in our case) to a Car class and will return it. This also very useful for POST requests where you define T with your class and request sender function serializes your class to JSON. This example would be much more useful then examples you showed. They give no additional value in your video IMO.
If I have a Persons (string name, etc) class to store in a list would it be better practice to use the existing List or make my own generic?
...What? List should already be a generic type; there's no reason to reinvent the wheel here.
সম্পূর্ণ বাংলায় C# (C Sharp) শিখতে পর্যায় ক্রমে: ua-cam.com/channels/niMHMSJvYxGX0DAfz5SQkA.html
Nice
kheili mamnon moshii
The finder of lost children...
Waaay too many ads in this video...other than that it's good though.