Never mind, i figured it out lol Thanks man, big help!
@SayWhaaaaaaaaaaaaaaaaaaaaaaat
5 жыл бұрын
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.
@FortyTwoAnswerToEverything
9 жыл бұрын
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.
@LazarRedDevil95
9 жыл бұрын
***** Nice, looking forward to asp.net mvc course . Thank you for sharing your knowledge
@johnoweston8976
5 жыл бұрын
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!
@willharrison-builds
9 жыл бұрын
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.
@cocoscacao6102
5 жыл бұрын
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.
@shaihulud4515
8 жыл бұрын
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!
@XXIcenturyblood
10 ай бұрын
0:10 - problem 2:44 - create generic list 6:32 - create generic dictionary 8:49 - constraints
@rodricmontique6294
5 жыл бұрын
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 :-(
@JohnnyB43
7 жыл бұрын
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.
@ahmedshalaby1878
4 жыл бұрын
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) { } }
@Furki4_4
Жыл бұрын
pretty concise video, thank you mosh. now I'll dive into details !
@vickyvirat5166
6 жыл бұрын
Probably one of the best explanation for Generics, plus very good explanation of piece by piece of Genrics. hanks!
@InLiveLife
3 жыл бұрын
Thank you, this video was much easier for me to understand than others on KZitem.
@beri4138
4 жыл бұрын
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.
@IDontReadReplies42069
4 жыл бұрын
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));
@marsaintarshiva
5 жыл бұрын
Still confusing
@briandoesdev
8 жыл бұрын
Your a great teacher! Can't wait for the ASP.NET course!
@jehnzcode
4 жыл бұрын
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.
@ryanisthewind
3 жыл бұрын
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.
@alzard6828
3 жыл бұрын
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?
@CanadianMang
6 жыл бұрын
I can't follow this for some reason. I understand what classes and objects are but I am having trouble understanding this.
@tomservo75
4 жыл бұрын
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.
@ufukseyithan
4 жыл бұрын
@@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.
@IDontReadReplies42069
4 жыл бұрын
@@tomservo75 dude if you don't know what basic shit is why are you here? Go back to helloworld beginner tutorials man.
@mrkarimian
3 жыл бұрын
Daste shoma dard nakone. I was stuck on this concept. Berfarma T. =)
@SydurRahman21
4 жыл бұрын
সম্পূর্ণ বাংলায় C# (C Sharp) শিখতে পর্যায় ক্রমে: kzitem.info/rock/niMHMSJvYxGX0DAfz5SQkA
@Hardgraf1
9 жыл бұрын
fantastic. perfect for my interview tomorrow!
@moshfeghhamedani
9 жыл бұрын
+Tom Hutch How did the interview go? :)
@hardgrafter3031
8 жыл бұрын
+Moshfegh Hamedani Got the job. Been there 8 months 😀
@bhanushkaekanayake9988
3 жыл бұрын
Best tutorial on generics. Thanks Mosh!
@mehrdadbozorgmehr8501
5 жыл бұрын
مشفق خان غزیز میکم ایم آموزش هارو برای ما که تو ایرانیم اگه کاملشونو فیری بزاری خیلی مردی. یا حداقل شماره حساب ایرانتو بگو :D
@salihawouda2992
6 ай бұрын
12:23 the generics get smaller everytime we go code down 😂😂😂
@STUPIDYOUTUBE_HIDINGMSGS
3 жыл бұрын
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
@tomservo75
4 жыл бұрын
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.
@angel_machariel
9 жыл бұрын
This is the second tutorial you have published that I watched. You're doing a damn good job!
@moshfeghhamedani
9 жыл бұрын
+A Freethinker Thanks!
@adeelmalik6002
7 жыл бұрын
Mosh you are the best instructor i have even studied Thanks a lot .........
@tigerboom9030
5 жыл бұрын
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.
@gyohza
4 жыл бұрын
Hmm. But what if you're building an API with response models? Generics are very useful in wrapping database query values.
@nlarsensmith
6 жыл бұрын
Hello Mosh, when we apply constraint class to a generic say " public class DiscoutCalculator where TProduct : Product " is same as saying " public class DiscountCalculator " ?
@fadmad7257
7 жыл бұрын
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.
@japhethjay4880
9 жыл бұрын
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.
@moshfeghhamedani
9 жыл бұрын
+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.
@japhethjay4880
9 жыл бұрын
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
@moshfeghhamedani
9 жыл бұрын
It's a commercial plugin for VS.
@shamus306
7 жыл бұрын
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?
@danish162
8 жыл бұрын
dude you are awesome, I learned about so many little things in things which I found very helpful, Thanks a lot :-)
@PurushNahiMahaPurush
5 жыл бұрын
Isn't this just Templates in C++?
@SBTRIS
4 жыл бұрын
Love your style - question though @16:13 you state _value is object, why not make that of type T?
@jeathtunes769
8 жыл бұрын
Mosh pit
@mamoor619
7 жыл бұрын
MessageBox.Show("LOL");
@ibrahimabdalla1642
4 жыл бұрын
Please please please make a tutorial on how to make a windows forms application like a calculator.
@scm2728
8 жыл бұрын
Amazing video ! Please do some video like this for exception handling. Good job!
@rajarathinambalasaubramani8610
9 жыл бұрын
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
@akhileshbaldi4696
8 жыл бұрын
Mosh you are an awesome teacher ! like the way you make things so simple to understand!
@osinnowo
7 жыл бұрын
You're very very very extra ordinary and extremely good. You're the best programming teacher I've ever seen.
@keithkatane4854
4 жыл бұрын
The finder of lost children...
@realsoftgames7174
7 жыл бұрын
@9.20 what is that line called. i cant remember for the life of me.
@solvedplus858
2 жыл бұрын
very cool, many thanks
@SheshagiriPai
8 жыл бұрын
You know your stuff man, awesome (Y)
@sensoukami
6 жыл бұрын
Waaay too many ads in this video...other than that it's good though.
@rinusluijk3514
9 жыл бұрын
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.
@rinusluijk3514
9 жыл бұрын
Oh ok, I see now. Thanks a bunch, it looks much better.
@FuzzyDPozzy
5 жыл бұрын
dam those youtube ads lmao i saw 6 ads while watching the video lmao
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
@niclast7600
4 жыл бұрын
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 :).
@funnydadcrazyson4112
8 жыл бұрын
Valuable content... Thanks for you hard work making this video and sharing it. Great video !!! Awesome.
@exSnake
9 жыл бұрын
You should do a tutorial about ICommand interface for WPF, it's annoying like the Events/delegate, i founded that tutorial nice!
@exSnake
9 жыл бұрын
+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)
@tannerpercival582
5 жыл бұрын
Polymorphism in action
@aditheorigin4926
8 жыл бұрын
What shortcut have you used to search file (program.cs)? [time 3:41]
@tevoj
8 жыл бұрын
+Adi TheOrigin ctrl + ,
@aditheorigin4926
8 жыл бұрын
+Estevan Jantsk I use the same but the control looks different!
@tevoj
8 жыл бұрын
+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.
@aditheorigin4926
8 жыл бұрын
+Estevan Jantsk : oh! okay. well, thanks for your response :)
@zardify_
9 жыл бұрын
2:17 I just made this mistake, and came here accidentally not knowing what "Generics" mean... :3 Shame on me! :D Thank you!
@zardify_
9 жыл бұрын
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?
@progalion4647
3 жыл бұрын
Nice and Easy , Thanks
@alkhulaqidev8930
5 жыл бұрын
lots of ads... this is bad!
@MsSergKV
8 жыл бұрын
For me is to fast, i'm a student and this is like more for working people! Also sometimes using shortcuts without explanation.
@patkartarun
4 жыл бұрын
Nice sir short and sweet (understandable)
@mastertt7929
9 жыл бұрын
Hi Mosh, Can you please make a video about how to accessing a SQL Server?
@iosifpuha6114
7 ай бұрын
this is sooooooo good even 8 years after, you a G
@rhubarbcheese
9 жыл бұрын
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.
@moshfeghhamedani
9 жыл бұрын
+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]
@rhubarbcheese
9 жыл бұрын
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?
@CarlHamilton1914
6 жыл бұрын
What a great video! I've seen generics in code but haven't really understand what they were doing until now. Thanks!
@baurks
6 жыл бұрын
Hi Mosh, I enjoyed watching this nice tutorial. Thank you! Can you please explain why should we use IComparable instead of IComparable?
@amirdaraee
6 жыл бұрын
بسیار عالی بود، مردم انقدر این ویدئو های هندی رو دیدم، اصلا قابل فهم نیست لحجشون !!
@elchino7672
5 жыл бұрын
3:41 How you open find pop-up on 3:41 ?
@chitrabarman8531
3 жыл бұрын
Is it used often?
@jz1838
9 жыл бұрын
Thanks for your effort. I will follow you. Thanks
@jackrobert8285
2 жыл бұрын
kheili mamnon moshii
@danielgerber9602
3 жыл бұрын
Why watch this for free here, when you can pay for it on Udemy?
@evviaccia
5 жыл бұрын
salam mosh khubi? chetori? :) i can speak a little bit persian. thanks for your videos. they are awesome. wish the best for you brother.
@danieldo2281
7 жыл бұрын
what keyboard do you use? sounds good
@MDM666666
9 жыл бұрын
Thank you sir you are a great teacher.
@moshfeghhamedani
9 жыл бұрын
+John Doe Thanks John!
@AS-sb8uo
9 жыл бұрын
awesome , you should create video on struct vs Classes , and when to use them
@shawn129386
7 жыл бұрын
Great job. Thanks a lot for this awesome video :)
@GarryWatson111
6 жыл бұрын
Thanks Mosh. Very useful.
@franciscooliveira8585
Жыл бұрын
Thanks!
@erkandotnet
8 жыл бұрын
very good
@troyincarnate8105
3 жыл бұрын
really good explanations.
@o.429
5 жыл бұрын
This is the perfect video for me. I was so confused about this topic. Everything is clear now. :)
@FuzzyDPozzy
5 жыл бұрын
thank you so much for the tutorial it was really well explained
Пікірлер: 136