C# generics ⁉️

Поділитися
Вставка
  • Опубліковано 27 січ 2025

КОМЕНТАРІ •

  • @BroCodez
    @BroCodez  3 роки тому +54

    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 8 місяців тому

      Bro we need advanced C# videos.

  • @robertmanigault625
    @robertmanigault625 3 роки тому +110

    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 2 роки тому +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 Рік тому +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 2 роки тому +33

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

  • @fjeanjoseph
    @fjeanjoseph 6 місяців тому +11

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

  • @codewithdalvin
    @codewithdalvin 7 місяців тому +3

    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!

  • @Andrew-mo9gy
    @Andrew-mo9gy 2 роки тому +12

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

  • @davestorm6718
    @davestorm6718 2 роки тому +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🙏

  • @Colin_Lawlor_Audio
    @Colin_Lawlor_Audio 3 місяці тому

    If only the millions of pages of documentation by major companies was only half as simple to understand as this.
    Thank you for speaking human, most programmers cant anymore.

  • @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!!

  • @_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.

  • @rain8635
    @rain8635 6 місяців тому

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

  • @VinayKhandagale-r8i
    @VinayKhandagale-r8i Рік тому

    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

  • @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

  • @noextrasugar
    @noextrasugar Рік тому +1

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

  • @vikneshar139
    @vikneshar139 7 місяців тому +2

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

  • @atauygur8852
    @atauygur8852 Рік тому

    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.

  • @redheadrusskie
    @redheadrusskie 3 роки тому +1

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

  • @cabbiechuck
    @cabbiechuck Рік тому

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

  • @floyd666uk
    @floyd666uk 2 роки тому +1

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

  • @rehanbhojani2112
    @rehanbhojani2112 2 роки тому

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

  • @DamnTimCan
    @DamnTimCan 2 роки тому +1

    Best clear explanation of why generics I have found. 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 😊 😅

  • @mirm0n
    @mirm0n 2 місяці тому

    Easy to understand and straight to the point. Thank you!

  • @daniyalahmed97
    @daniyalahmed97 2 місяці тому

    Bro youre an absolute g. You make coding simple af

  • @LeonardoMolina-gr5lo
    @LeonardoMolina-gr5lo 2 роки тому

    Great, Clear, Concise. Just amazing

  • @mamabrowsss1160
    @mamabrowsss1160 2 роки тому

    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 :)

  • @fredchuks7822
    @fredchuks7822 2 роки тому

    Best explanation of generics ever! Thanks a lot.

  • @fozler
    @fozler Рік тому +1

    Genius explanations brother

  • @John99YT
    @John99YT 3 місяці тому

    Thank you ❤ not even my teacher explained this. I wonder how they got hired. However they introduced me to method overloading which you used in first place.

  • @DuI41093
    @DuI41093 2 роки тому

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

  • @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 !!!

  • @ag4-z4z
    @ag4-z4z 10 місяців тому +2

    0:19 that was such a solid uhhhhhhhahhhhhhhh

  • @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!

  • @Yinyan662
    @Yinyan662 2 роки тому

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

  • @vidazarei3951
    @vidazarei3951 2 роки тому

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

  • @LuzuVlogsGamer
    @LuzuVlogsGamer Рік тому +1

    This is what Perfection looks like ;o

  • @Atom-Mercury
    @Atom-Mercury Рік тому

    You explain so well, bravo Bro.

  • @UlisesGB.
    @UlisesGB. Рік тому

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

  • @nueledem3525
    @nueledem3525 2 роки тому

    So simple! An amazing teacher!

  • @SAMSTUDY-m4d
    @SAMSTUDY-m4d 5 місяців тому +1

    Really Good man.

  • @kylekyle8131
    @kylekyle8131 2 роки тому

    Clear and straight to the point! Awesome video 👍

  • @001marselle
    @001marselle Рік тому

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

  • @kirillberia1797
    @kirillberia1797 3 роки тому +1

    Love your tutorials!

  • @AbdullahAkhtar-mo7ro
    @AbdullahAkhtar-mo7ro 5 місяців тому

    Brilliant explanation in less time 😇

  • @andywawa7227
    @andywawa7227 2 роки тому

    clear, structured and simple, thanks bro 😉

  • @YuriiHonta
    @YuriiHonta 2 роки тому

    Using THING to explain is giving us association. Genius.

  • @قناةالطيبالمعلوماتية

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

  • @РахматиллаАбдукадыров-ф8щ

    cool video,nice explanation,thanks

  • @suzu6165
    @suzu6165 11 місяців тому

    PERFECT. thank you so much sir 🙏🙏

  • @pydzio
    @pydzio 2 роки тому

    Awesome! This concept is actually very easy to understand.

  • @manikandanu1507
    @manikandanu1507 2 роки тому

    Thanks bro. It's very helpful ☺️👍

  • @uweopfern
    @uweopfern 2 роки тому

    Best generics tutorial that i have ever seen

  • @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!

  • @glasgood9907
    @glasgood9907 4 місяці тому

    Straight to the point

  • @hayotbahromnurdinov7409
    @hayotbahromnurdinov7409 Рік тому

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

  • @staayfan
    @staayfan 2 роки тому

    Merci infiniment bro… simple and very precise

  • @ahmedel-saadany703
    @ahmedel-saadany703 2 роки тому

    Fantastic brooo🖤

  • @danielam1247
    @danielam1247 Рік тому

    Thank you it was very clear bro!

  • @givolimyerukim
    @givolimyerukim 2 роки тому

    very straight forward, thanks bro

  • @GovindKumar-xj9yw
    @GovindKumar-xj9yw 16 днів тому

    Clear and concise

  • @redteamgarage299
    @redteamgarage299 25 днів тому

    Thank you so much for this ❤

  • @rashidfarhan6223
    @rashidfarhan6223 11 місяців тому

    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.

  • @cyrocyro7904
    @cyrocyro7904 2 роки тому

    Man keep up the good work

  • @tbtmtfth
    @tbtmtfth Рік тому

    great videoooo

  • @FullExtension1
    @FullExtension1 2 роки тому

    you are such a bro, bro

  • @enespinar9711
    @enespinar9711 Рік тому

    Bro you taught me better than my college professor

  • @justamovie
    @justamovie 2 роки тому

    🤯Thanks, Bro!

  • @spartanranger
    @spartanranger 3 роки тому

    Thanks for the video Bro.

  • @mostafataheri4939
    @mostafataheri4939 Рік тому

    tnx that was grate
    👍👍

  • @lethokuhleNongcebo
    @lethokuhleNongcebo Рік тому

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

  • @fushitensho7840
    @fushitensho7840 2 роки тому

    my lifesaver

  • @slashd
    @slashd 2 роки тому

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

  • @aliabouhawia1563
    @aliabouhawia1563 3 роки тому +1

    Thanks Bro:)

  • @mertkurt947
    @mertkurt947 Рік тому

    so understandable , thanks much

  • @nickout99
    @nickout99 2 роки тому

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

  • @UmarAlFarooq
    @UmarAlFarooq 2 роки тому

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

  • @yushi2220
    @yushi2220 Рік тому

    Thank you

  • @Lonchanick
    @Lonchanick Рік тому

    Nice!

  • @Adze-yah
    @Adze-yah 2 роки тому

    ggs, this explanation helped me well.

  • @caseyspaulding
    @caseyspaulding 2 роки тому

    Wow nice!

  • @KhaledAlhelwane
    @KhaledAlhelwane Рік тому

    thank you 🥰

  • @armm6437
    @armm6437 2 роки тому

    very useful!

  •  3 роки тому

    Thanks Bro!

  • @amplifiedge
    @amplifiedge Рік тому

    thank you bro!

  • @fistofjustice13
    @fistofjustice13 Рік тому

    Thanks bro

  • @MuzammilKhan-s3k
    @MuzammilKhan-s3k 3 дні тому

    Nice

  • @vasykloepexergasia7562
    @vasykloepexergasia7562 Рік тому

    east or west
    bro is the best

  • @fisix5151
    @fisix5151 10 місяців тому

    yo thank you brother

  • @cimiur
    @cimiur 4 місяці тому

    random comment down below. very useful video. thanks!

  • @MariemMili
    @MariemMili 2 роки тому

    thanx😄

  • @euphoriaorphan
    @euphoriaorphan Рік тому

    thanks bro

  • @chrisgille1460
    @chrisgille1460 2 роки тому

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

  • @prathameshgaikwad7550
    @prathameshgaikwad7550 2 роки тому

    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?

  • @ic_1234
    @ic_1234 Рік тому +1

    why doesnt it print 1.0, 2.0, 3.0?

  • @TidyWaste
    @TidyWaste 6 місяців тому

    Thoughts and prayers lol

  • @kvelez
    @kvelez Рік тому

    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 + " ");
    }
    }