C# Generics - What they are, why they are useful, and how to create them

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

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

  • @marienoellemaltais
    @marienoellemaltais 6 ปีที่แล้ว +206

    You are such a great teacher. Many blessings to you. Simplicity is born out of a deeper understanding. Your tutorials are brilliant, like a breath of fresh air.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +15

      Thank you for the kind words.

    • @ValiRossi
      @ValiRossi 5 ปีที่แล้ว +8

      I agree. Every lesson is very consistent which helps in the learning process.

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

      "Simplicity is born out of a deeper understanding" .........deep
      And yes, Tim Corey is the best

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

      Glad you're still with us. Sounds like a crazy experience, that tsunami... Hopefully one day I will learn French or find a translated copy of your book. Interesting to see you coding!

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

      And his voice as well 😍

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

    the beauty of this channel is it shows the practical usage of the theoretical concept.

  • @NM-tr1ii
    @NM-tr1ii 2 ปีที่แล้ว +9

    You're my fav C# instructor. Period! I don't know what moment or who sparked the idea in your head that you decided to share your knowledge with the world, I'm just grateful that you did :-)

  • @MS1022YT
    @MS1022YT 4 ปีที่แล้ว +34

    Tim, great course.
    I like the way you explain "why" we would use Generics in real-world scenarios as opposed to just giving us "high-level" examples. Note that this teaching method sets you apart from other teachers.
    Also, you showed us an example where originally we don't use generics and then where (and why) we would use Generics (code reuse and decoupling logic implementation from actual data types).

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +2

      I am glad you found it helpful.

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

    I haven't come across a better teacher for C# programming online. Thank you so much for what you are doing!

  • @huzaifatinwala
    @huzaifatinwala 5 ปีที่แล้ว +12

    Best C# generics tutorial I have come across. Thanks, Tim. Really appreciate it.

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

      You are most welcome. Thanks for watching.

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

    Good one. Restriction and mentioning empty constructor was new to me. Thank you

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

    Everyone on here has benefitted from Tim in one way or another. Please subscribe to this man's Patreon, even if it's just the $1, that's nothing compared to the value he provides us for FREE! Support this guy!!!

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +2

      I appreciate the kind words and the support.

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

      Or sign up his courses to support him..

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

    That is an excellent and simple explanation. I had some confusion about Generic methods, which are cleared now.
    Thank you.

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

    Tim, again, an older but very timeless video. Thanks for the clear explanation on generics!

  • @Stone8age
    @Stone8age 8 หลายเดือนก่อน

    This is great. You concisely explained a concept that i originally perceived to be intimidating and confusing. Bravo

    • @IAmTimCorey
      @IAmTimCorey  8 หลายเดือนก่อน

      I am glad it was helpful.

  • @christianromedahl4456
    @christianromedahl4456 4 ปีที่แล้ว +2

    Agree. One of the best teachers that I've found so far. Really clear, in-depth, not going on too fast (like some others just rushing on), so it's easy to follow and grasp. Brilliant! Thanx a lot. :)

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

      You are most welcome. Thanks for watching.

  • @n9434178
    @n9434178 6 ปีที่แล้ว +17

    Thank you Tim! This video improved my understanding of the use of generics.

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

    Adicted to IAmTimCorey channel. Learning makes easy when we find the right person who can answer our questions without asking them. You are a Great teacher and your efforts are really amazing. Thank you so much Sir. Love from India

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

    Best Video in Advance Topics Playlist up till now. I loved the generic methods because I faced this problem in my previous organization.

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

      Glad it was helpful!

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

    Nice video as always Tim. Just a note on 35:20 for anyone interested in reflection:
    You can still grab the properties of a class, using reflection, without creating an instance of that class. This will compile and perform the same task: *var cols = typeof(T).GetProperties();*
    The instance was still needed in Tim's example though, since he's returning instances of that class in the Load method.

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

      Yep, thanks for pointing that out.

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

    thanks a lot for this excellent and wonderful tutorial about generics.
    I made some changes on reflection parts and I would share with you guys:
    public static List LoadFromTextFile(string filePath) where T : class, new()
    {
    var lines = System.IO.File.ReadAllLines(filePath).ToList();
    List outputList = new List();

    var properties = typeof(T).GetProperties();

    if (lines.Count < 2)
    throw new IndexOutOfRangeException("The file was either empty or missing.");
    // Splits the header into one column header per entry
    var headerColumns = lines[0].Split(',');
    lines.RemoveAt(0);
    foreach (var row in lines)
    {
    T entry = new T();
    var rowValues = row.Split(',');
    foreach (var column in headerColumns.Select((columnName, columnIndex) => new { columnName, columnIndex }))
    {
    var propertyRef = properties.SingleOrDefault(property => property.Name == column.columnName);
    if (propertyRef != null)
    {
    object typedValue = Convert.ChangeType(rowValues[column.columnIndex], propertyRef.PropertyType);
    propertyRef.SetValue(entry, typedValue);
    }
    }
    outputList.Add(entry);
    }
    return outputList;
    }
    public static void SaveToTextFile(List lstData, string filePath) where T : class
    {
    List lines = new List();
    if (!(lstData?.Count > 0))
    throw new ArgumentNullException("data", "You must populate the data parameter with at least one value.");
    var properties = typeof(T).GetProperties();
    lines.Add(string.Join(",", properties.Select(c => c.Name)));
    foreach (var row in lstData)
    {
    var rowValues = properties.Select(c => c.GetValue(row)).ToList();
    lines.Add(string.Join(",", rowValues));
    }
    System.IO.File.WriteAllLines(filePath, lines);
    }

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

    I have been using generics for a quite long time, but never managed to understand how to make one. you explained it very well.
    Many thanks Tim Corey

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

      Awesome! I'm glad I could add to your knowledge.

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

    I learned generics before. But today I learned why and when I should use it. Thank you !

  • @STUPIDYOUTUBE_HIDINGMSGS
    @STUPIDYOUTUBE_HIDINGMSGS 4 ปีที่แล้ว +2

    what I iike about your tutorials like this one, is you don't over complicate things and I believe you always consider the level of skill of your watchers, explaining how and why things are done in a certain way. thanks Tim.

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

    Thanks Tim for giving so much to the community.

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

    This is excellent and simple tutorial on C# generics. Thank you for your efforts and sharing your precious knowledge.

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

      I am glad you enjoyed it.

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

    Very clever example and code Tim. Just the right amount of complexity. Liked the reflection thrown in too. Thank you.

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

    I have no idea how anyone could possibly give this video a thumbs down. Thanks Tim! You are awesome. I'll be heading over to Patreon real soon. Appreciate all you do to make our lives easier and wealthier!

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

      I appreciate the kind words.

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

    Merci bien for your hard efforts to enlighten us Tim! You are an inspiration to start making a good code.

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

    Man been watching and liking all your vids. They are solid. As a person finishing up a year's worth of c# classes, I still find your way of teaching really easy to understand, and the tips and way in which you deliver information is extremely helpful. Many thanks buddy!

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

      You are most welcome. Thanks for watching.

  • @jean-marcblanchet2270
    @jean-marcblanchet2270 3 ปีที่แล้ว +1

    Well, thank you Tim for the great content you provide for free to us, the C# developers community. I have an old habit I took when learning C language, a long time ago when I was a student. I always put my checking code at the beginning of my methods, before any declaration or usage of variables and objects. So that I get rid of incorrect or incomplete values before going further, for instance by raising an exception or returning an error code. I don't know if it's a good practice, but I'm sure data is correct after that checking step.

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

    Thank you for your videos, there are amazing. You help me so much to learn, and your sound and spelling is so clear to make it easy to understand for people that english isnt their native language.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +2

      I am glad my content has been so helpful.

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

    Finaly an example where this is actualy useful. Now I understand the whole thing much better. Thanks a lot!

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

    I've been working with .NET, and primarily C#, since before it was even publicly available and I still learn great things from your videos. Thank you!

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

      You are most welcome. Thanks for watching.

  • @patatas.m1317
    @patatas.m1317 4 ปีที่แล้ว +1

    You are so good sir, you explain it clearly. Even the topic is pretty advance for me, I can imagine things by your words. Thanks for making this video:)

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

    It was very helpful for me. Thank you Tim.

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

      Glad it was helpful!

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

    Great work Tim! Your syllable timing is perfect and I can run your video at 1.25 or 1.5 times and it still seems normal to my fast Brain.

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

    This opened my mind to a lot of things that Ive seen on your other videos but which I did not fully appreciate - until now

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

    Tim, 12,114 views and 418 likes and "0" dislikes as on date, That speaks quality of this video. :)

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

    It's really helpful. Sir, only with your video did I learn why, I have to use generic. Thanks a lot.

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

    Thanks again Tim for a great tutorial. I actually just used what I learned on a project where I have a method that calls a Web API and was returning JSON. Then I would deserialize it in the calling method into the proper type. Now I just use generics and this method returns the object that I called for. So much nicer.
    Old code...
    public static async Task SendRequest(HttpMethod method, string requestUri, object payload = null)
    which returned the raw JSON string
    New code.
    public static async Task SendRequest(HttpMethod method, string requestUri, object payload = null) where T : class
    which returns JsonConvert.DeserializeObject(responsePayload)

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

      Great! I am glad it was so useful.

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

    Wonderful content Tim. Kudos to you!

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

    Excellent video, Generics have always been a bit confusing to me and it helps me best when there is a practical demo like in this video. So thanks for that

  • @MrGegere
    @MrGegere 4 ปีที่แล้ว +2

    Heh, I needed 6 minutes of Your video to understand what I need.
    Truly great content.

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

    Great material, bravo Tim!

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

      Thank you!

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

    Yes, Generic is useful, it can reduce duplicate code. Thank you very much. Very precise explanation.

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

    Very helpful, thank you.

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

    Thank you. Very informative. Very well explained.

  • @luih7314
    @luih7314 5 ปีที่แล้ว +4

    You're my hero Timmy
    Such an emotional video, you killed off Sue Storm :)

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +6

      It was a rough one, but don't forget, Sue is a comic book character. They never really die.

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

    Good job! I appreciate you posting your videos.

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

    That you very much. Has really improved my understanding regarding this topic. You are an excellet teacher

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

      Awesome! I'm glad you were able to increase your understanding of the topic.

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

    Great explanation, greetings from Argentina

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

    Great example, very useful. Thanks a lot

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

      You are welcome.

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

    Thank you Tim! I work at company where we use C# and MVVM pattern, I learned some new things from you. :)

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

    Great job!

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

    I had a light-bulb moment when you showed the reason why not to use ArrayLists. Suddenly everything made sense. Thanks Tim.

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

    Appealing tutorial.

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

    28:27 "I was tired at 4:29 AM", me too, Tim, me too...

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

    Best tutorials on C#! Keep going!

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

    am impressed, i wanna do more generics with different class properties.

  • @alexanderspiegel6747
    @alexanderspiegel6747 5 ปีที่แล้ว +13

    Here is my “like”, Tim. Thanks for the great lesson.

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

      You are most welcome. Thanks for watching.

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

    Another great video clearly explaining an area that is often misunderstood!

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

    Hey Tim! I am a very big fan of your videos! Thank you for helping me learn C#!
    I was wondering if you plan to make a follow-up on generics and speak about how we can use generics and dependency inversion together as principles to make dynamic interfaces that we can reuse?
    I think it is a very interesting and challenging topic that most people would appreciate.

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

      Added to the list, thanks.

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

    this is the best tuts, very clear

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

      I am glad my content is helpful to you.

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

    Your videos are clear and simple and I enjoy watching it. I've tried Pluralsight before and all of the teachers so far (like 4 people) were unnecessarily complicating stuff and were very formal and boring. Thanks a million Tim.

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

      I appreciate the kind words.

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

    She glad I found this channel!! Thank you Tim!

  • @JohannJimenez
    @JohannJimenez 6 ปีที่แล้ว +2

    Perfect explanation. Thanks.

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

    Great lesson, Tim. You've done a great jog teaching us how to handle with C# technology, Thank you so much.

  • @ShambhuChouhan-o6f
    @ShambhuChouhan-o6f 5 หลายเดือนก่อน

    Great effort put by creator

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

    I just whatch your video about interfaces and now generics , We can have a lot fun mixing these two consepts

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

    Bow to the king.

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

      I'm glad you enjoyed it.

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

    Great video and explanation. I have trouble learning a lot of advanced C# like this though. Even if i understand it i need to use it in practice multiple times to actually make it stick in my head. And when its things like this that has very rare use cases its very hard. You get a long way with the very basics of C#, and that can become a problem.

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

      Practice is definitely important. The more you practice it, the more you will grasp it.

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

    very very awesome , you are so great, yesterday i was creating method to write and read xml files and i couldn't make them generic, know i now why and thanks to you
    many many thanks

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

    Thank you Tim

  • @roberttan3736
    @roberttan3736 6 หลายเดือนก่อน

    Thankfull for all of your video sir.

    • @IAmTimCorey
      @IAmTimCorey  6 หลายเดือนก่อน

      You are welcome.

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

    Thanks Tim for explaining the concept of Generics in simple terms. You could have also covered the complexity analysis in more detail while discussing the applied reflections. But You did explain it a little bit in terms of time I guess...

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

      I have constant thoughts on how to improve every video. Part of that led me to make this video on balancing that desire for perfection - th-cam.com/video/b5TspWBQkMk/w-d-xo.html

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

    amazing explaining

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

    Your videos are insanely good. Love it.

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

    You are that perfect c# book I was looking for!

  • @al-omdaahmed3191
    @al-omdaahmed3191 5 ปีที่แล้ว

    you are a great tutor , thank you again and again for these videos

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

    good video. nice coverage of C# and basic file io as a bonus. generics can be confusing if newly introduced to the concept, but a good explanation overall.

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

    Awesome! What a great lesson. Thank you.

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

    Notes that i took:
    Generics are helpful to for example not create mutliple methods doing the same thing.
    Imagine having an array of type int, an array of type double and array of type string.
    If you'd want to print out the contents of these arrays, you would normally have to create three methods with three different parameters to display them. One with an int parameter etc.
    Instead, you can create a Generic Method.
    A Generic Method is created by putting " " at the end of the Method name. Then the parameter.
    Instead of putting a data type as a parameter, you can instead put "T" as a parameter and then call it three times with the different arrays.
    So instead of having 3 different Methods to call these three different arrays with different data types, you can create one generic method which accepts all data types.
    You can call your generic whatever you want, it doesnt have to be "T".
    ------------------------------------------------------
    The T in generics specifies which type we are talking about.

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

      I'm glad you were following along.

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

      Thank you so much sir! That was a very clean explanation and a brilliant example! Now I understood.

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

    Thank you very much. I love this channel and found it very useful. I also love your way of teaching.

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

      You are most welcome.

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

    Great video. Thanks a lot.

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

    Thank you for this video

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

    Thanks for the great lesson Tim!

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

    Thanks a lot, great example! You've got to love it!

  • @neemapranay23
    @neemapranay23 4 ปีที่แล้ว +8

    In India today (5th September) we are celebrating Teachers day. And for me, you are one of the best teachers I came across.
    Happy Teachers Day Tim!!

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

    thank you. really clear.

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

    Excellent!

  • @pp-studio
    @pp-studio 4 ปีที่แล้ว

    Recently, I watched your content aboute interface. It's make understand it more details. Thanks for your information and great example 😊

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

      You're very welcome!

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

    Great video. You really know how to explain things

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

    Great tutorial. You could possibly optimise the code in the SaveToTextFile method by creating another method that loops through the columns and build the line without the trailing comma, as this code is duplicated.

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

    Thanks alot for great videos and channel

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

    Thank you sir

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

    This is my 2nd favorite video you've made. :-)

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

      Awesome! What's the first?

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

    Very good videos !!

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

    Nice explanation, thanks

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

    Köszönjük!

  • @risechess7114
    @risechess7114 9 หลายเดือนก่อน

    the hardest way ever of explaining Generics why choose a very hard example to explain Generics why choose advance way (where T)if beginners like me dont know the simple way () not recommended for beginners

    • @IAmTimCorey
      @IAmTimCorey  9 หลายเดือนก่อน +1

      This is nearly a one-hour tutorial on the topic of generics. Maybe approach it as a course on generics rather than just a beginner's tutorial. The beginning (first 20 minutes or so) is the beginner tutorial. Then we go deeper from there.

  • @tobiowolawi5044
    @tobiowolawi5044 6 ปีที่แล้ว +2

    life would have been better if those expensive books and college courses explain programming in this way. i believe generic classes would create the same effect and converting those methods to non static so that they can be instantiated please correct me if am wrong (apologies, i just saw you mentioned it at the end of the video :D)

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

      Glad I could answer your question by the end.

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

    Pre-C19 Goals: Buy new Gaming Desktop.
    Quarantine Goals: Buy Tim Corey courses.

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

      It has changed a lot of priorities.

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

    In the load LoadTextFromFile function The that you pass in is a string, but then you say "Where T : class, new()". Wouldn't that "Where" statement require you to pass in something like a Person instance or LogEntry instance rather than a string?