C# generics ⁉️

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

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

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

    using System;
    namespace MyFirstProgram
    {
    class Program
    {
    static void Main(string[] args)
    {
    // generic = "not specific to a particular data type"
    // add to: classes, methods, fields, etc.
    // allows for code reusability for different data types
    int[] intArray = { 1, 2, 3 };
    double[] doubleArray = { 1.0, 2.0, 3.0 };
    String[] stringArray = { "1", "2", "3" };
    displayElements(intArray);
    displayElements(doubleArray);
    displayElements(stringArray);
    Console.ReadKey();
    }
    public static void displayElements(Thing[] array)
    {
    foreach (Thing item in array)
    {
    Console.Write(item + " ");
    }
    Console.WriteLine();
    }
    }
    }

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

      Hi! Could you make a video about topic "How to handle 2 keys pressed simultaneously in java"? Please... I'm Vietnamese and I'm really looking forward to this

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

      Thanks for code.

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

      Bro we need advanced C# videos.

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

    I watched 2 other videos in which the presenters, although very knowledgeable, rambled on incessantly while attempting to explain generics. Your explanation is clear and concise and above all, effective. Keep up the good work, Bro.

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

      Exactly right?? Damn, why can't they be like this guy, just get to the point and get done with it!

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

      ​​@@UmarAlFarooqi'm from Russia, i even got it, but i knew

    • @johansno5019
      @johansno5019 11 หลายเดือนก่อน +2

      Exactly. I feel most tutorials are like that. Too much unnecessary info and jumping from thing to thing, and just skimming through what you want to know. I love when it's just straight to the point like these

  • @black-forest-code
    @black-forest-code ปีที่แล้ว +31

    This is the shortest but most understandable video on Generics I've found so far! Thanks very much!

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

    To the point. No spending 30+ min just to explain a simple concept. Thanx

  • @Andrew-mo9gy
    @Andrew-mo9gy ปีที่แล้ว +11

    This is the best explanation of generics I've ever heard. Made it so simple to understand. Great demo. Thanks 🙏

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

    I've watched some videos about C# in english and spanish and as far as now you are one of the best choices for learning C# because the way you explain all that thing easy. Thanks!

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

    Not sure how I got away with not using generics in many years of programming, but I wish I had before. This is the most concise explanation I've seen (there are hour long videos on this topic, but this is the best).

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

    Holy balls bro I'm taking my first uni course on C# and every one of your videos that I've watched has been an absolute godsend🙏

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

    this was actually such a simple yet super helpful explanation and great visualized by the example! thank you so much :)

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

    That's some precise explanation about generics. Nice bro!!!

  • @Bear-nr9jo
    @Bear-nr9jo 3 ปีที่แล้ว +4

    Best teacher fr

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

    A great simple explanation of something I had 'worried' over through the years. I can see now that a long-winded explanation is not necessary. If anything, that long-windedness begins the trip into confusion. I can see no that generics took 'overloading' a step further!! Thanks!!

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

    Clearest, most concise example of generics I have come across!

  • @atauygur8852
    @atauygur8852 7 หลายเดือนก่อน

    I am 👌 this close to start worshipping you. It is amasing you can make me feel confident about magical and scary words I always hear in tutorials and courses in 5 minutes.

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

    Best clear explanation of why generics I have found. Thank you

  • @noextrasugar
    @noextrasugar 10 หลายเดือนก่อน +1

    Broooo I hit like after first 5 sec, and the ‘Thing’ just seal the deal 🤝 immediately subscribed! Best 5mins video series !!

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

    🤧🤧🤧 I'm in tears, the first language that I learnt is javascript and now in my company we use c#, I have searched a number of videos and articles and they all try to confuse generics as much as possible but this video is a gold mine, I have to scroll down for this video to show up, I will share this channel so others can subscribe to this too, thank you very much bro.

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

    A copiously underrated channel. I love your stuff, please keep it up!

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

    Excellent video, always struggled with generics and you've just made me get it in 5 mins.

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

    Thank you! While watching this I've had realizations in which "I could have done that during my functions in xxx"
    Thank you so much, you explain everything so well

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

    Genius explanations brother

  • @FREDO-py4ti
    @FREDO-py4ti ปีที่แล้ว

    Thank you Sir for this quick and clear explaination about GENERICS...i understand it a little bit better !!!

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

    straight to the point and easy to understand. Thanks Bro Code!

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

    I can't even count the number of videos I've watched on Generics and it still confuses me. After watching this, and the way you kept it simple and straight to the point, I finally get it!! Thank you :)

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

    Bro you are the best. Thank you for teaching us about generics. I liked, commented, and shared your valuable video. It needs to he spreaded in order to teach all who are willing to learn. Definitely, a lot of wandering souls who are lost on thia topic 😊 😅

  • @Atom-Mercury
    @Atom-Mercury 10 หลายเดือนก่อน

    You explain so well, bravo Bro.

  • @user-rp1bp3wu8l
    @user-rp1bp3wu8l ปีที่แล้ว

    So well explained! Have been confused about what the means and nobody ever explained it's just something you can name according to your choice

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

    Best explanation of generics ever! Thanks a lot.

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

    Thank you so much, you explained Generics in the simplest way.

  • @LeonardoMolina-gr5lo
    @LeonardoMolina-gr5lo ปีที่แล้ว

    Great, Clear, Concise. Just amazing

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

    thank you for these short and effective explaining videos! keep up the good work!

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

    Bro your explanation are really simple its really easy to understand . Thank you very much

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

    i never comment, but i must tell u that u are the best and explain concepts straight forward

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

    I like your videos since you convert the difficult things to easy

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

    short, specific and great. You got a new subscriber :)

  • @AbdullahAkhtar-mo7ro
    @AbdullahAkhtar-mo7ro 22 วันที่ผ่านมา

    Brilliant explanation in less time 😇

  • @user-fs1hv7dk7o
    @user-fs1hv7dk7o 2 ปีที่แล้ว

    Using THING to explain is giving us association. Genius.

  • @user-sf9zj9eo7d
    @user-sf9zj9eo7d ปีที่แล้ว

    cool video,nice explanation,thanks

  • @LuzuVlogsGamer
    @LuzuVlogsGamer 10 หลายเดือนก่อน +1

    This is what Perfection looks like ;o

  • @glasgood9907
    @glasgood9907 วันที่ผ่านมา

    Straight to the point

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

    PERFECT. thank you so much sir 🙏🙏

  • @user-ye7fo5mw7h
    @user-ye7fo5mw7h ปีที่แล้ว

    ّ I learned a lot from you. Thank you so much

  • @BeastShortsHub-p2m
    @BeastShortsHub-p2m 18 วันที่ผ่านมา +1

    Really Good man.

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

    Clear and straight to the point! Awesome video 👍

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

    Wow light bulb moment. So many times I have had code that I try to avoid duplicating and the only difference is the data type resulting in me having to duplicate the code. This is the solution! I am surprised none of the 5 senior Devs at my workplace ever mentioned using generics in the code review though!

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

    Awesome. I've been searching everywhere for an explanation on this syntax. Finally found it in an accent I understand and with a very easy to understand example. Well done Bro !!!

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

    So simple! An amazing teacher!

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

    Awesome! This concept is actually very easy to understand.

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

    very straight forward, thanks bro

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

    thanks bro for your helping, I thought I never understand generic types

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

    clear, structured and simple, thanks bro 😉

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

    Love your tutorials!

  • @danielam1247
    @danielam1247 7 หลายเดือนก่อน

    Thank you it was very clear bro!

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

    HELL YEAH BROTHER! I'LL ALWAYS TYPE THING FROM NOW ON!

  • @Siuuu-gy8ro
    @Siuuu-gy8ro ปีที่แล้ว

    I like how you only explain the subject of the video. You explained what generics are, thats it. You could also have explained sorting with generic types but that would be to much info and people might get confused. W bro code.

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

    Best generics tutorial that i have ever seen

  • @lethokuhlemntungwa3715
    @lethokuhlemntungwa3715 7 หลายเดือนก่อน

    Omg, Thanks.. This was so helpful🙏
    Why is the double display a whole number and not a decimal?Just curious

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

    Thanks bro. It's very helpful ☺️👍

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

    Merci infiniment bro… simple and very precise

  • @alexgolomb363
    @alexgolomb363 5 หลายเดือนก่อน

    0:19 that was such a solid uhhhhhhhahhhhhhhh

  • @ahmedel-saadany703
    @ahmedel-saadany703 ปีที่แล้ว

    Fantastic brooo🖤

  • @cimiur
    @cimiur 5 วันที่ผ่านมา

    random comment down below. very useful video. thanks!

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

    so understandable , thanks much

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

    Bro you taught me better than my college professor

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

    Thanks Bro:)

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

    tnx that was grate
    👍👍

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

    great videoooo

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

    🤯Thanks, Bro!

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

    Thank you

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

    you are such a bro, bro

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

    Man keep up the good work

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

    Can we get an example how to use this with multiple add functions for Entity Framework?

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

    very useful!

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

    thank you 🥰

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

    Thanks bro

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

    Nice!

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

    Thanks for the video Bro.

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

    my lifesaver

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

    Would be nice too see if it would show decimals and alphanumeric characters also, just to see what the limitations are

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

    Thanks Bro!

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

    int[] intArray = { 1, 2, 3, };
    double[] doubleArray = { 1.0, 2.0, 3.0 };
    string[] stringArray = { "one", "two", "three" };
    displayElements(intArray);
    displayElements(doubleArray);
    displayElements(stringArray);
    static void displayElements(T[] array)
    {
    foreach (var item in array)
    {
    Console.Write(item + " ");
    }
    }

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

    thank you bro!

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

    Wow nice!

  • @euphoriaorphan
    @euphoriaorphan 10 หลายเดือนก่อน

    thanks bro

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

    thanx😄

  • @Adze-yah
    @Adze-yah ปีที่แล้ว

    ggs, this explanation helped me well.

  • @TidyWaste
    @TidyWaste 2 หลายเดือนก่อน

    Thoughts and prayers lol

  • @fisix5151
    @fisix5151 5 หลายเดือนก่อน

    yo thank you brother

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

  • @ic_1234
    @ic_1234 11 หลายเดือนก่อน +1

    why doesnt it print 1.0, 2.0, 3.0?

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

    east or west
    bro is the best

  • @LeonardoMolina-gr5lo
    @LeonardoMolina-gr5lo ปีที่แล้ว

    Just liked, subscribed. Honestly if you read this thank you! Plus code in comments ;)

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

    I just want to know can we use var or object data types as parameters for methods and a var or object data type in foreach loop?

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

    Bro, you are AWESOME! You explained something in such a simple and straightforward way; that Tim Corey is a JOKE compared to your content.

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

    Yay, First Like

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

    When he calls displayElements(doubleArray);
    So in output why does it shows 1, 2 ,3 why not 1.0, 2.0,3.0 thats what he defined right someone please explain

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

    thx dude

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

    🤩

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

    So you can pretty much use generics as a alternative of boxing and unboxing??

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

    This video is great! Consider that like button obliterated.