C# Hashsets - Understand them, use them, LOVE them

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

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

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

    🚀 C# Progress Academy - Become a job-ready C# and Angular web developer to land your dream developer role: bit.ly/45vbPUg

  • @codeme8016
    @codeme8016 ปีที่แล้ว +9

    I've worked with several languages including Java, C++, and Python. In my opinion C# (now dotnet core) has been the most comprehensive and clear syntax I've experienced with a lot of great new features with every new version. Just love it.

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

    Hi there, someone probably mentioned this but your array section is adding to your list

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

    Under the arrays your adding stuff into the list not the array

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

    Thanks👍

  • @VivekSingh-og6tv
    @VivekSingh-og6tv ปีที่แล้ว +5

    Thank you Brother 😇 your videos help me to learn about .Net c#.

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

      Happy to hear that. I'm also excited to learn more and teach what I've learned :)

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

    Very well presented. Thank you.

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

    dude introduced hashsets to us like it's our lord and saviour. Now I am a disciple.

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

    Just curious, is this quicker than LINQ using Distinct() ?

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

    Great video. I find myself using collections more than hashsets in c#, because normally the data has key-value pairs (such as id and description). And in MVC drop downs for example normally require a key value pair like a selectlist. Do you have any thoughts on collections vs lists vs hashsets? After watching this I’m wondering if there are places I can simplify collections into hashsets, or do you find most real-life apps require collections because we normally have unique ids associated with our data?

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

      Hi, I think that this is quite hard to answer because it relies on the purpose of your code. Fact is, that you should try to take the best data structure for your codes purpose. Usually you will be fine with any kind of collection and if you do not care about duplicates an array or a list will be your best bet. If you need kvps then a dictionary and if they you don't want duplicates, you pick the hashset.
      It really depends... :)

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

    The functionality you describe and show is great, but God forbid someone choses to do this, unless the data has already been retrieved, in application code. This should be done by the database; after all, it’s actually BUILT with data manipulation as it’s primary purpose. I can do all the stuff here with the Distinct, Group By, and Join clauses of SQL.
    In any case, the fact that the data is keyed on it’s actual hashcode is useful for various scenarios. In the data world, that’s called a natural key, and it means that the key IS the data, so it’s very fast at retrieving data. Using hashsets, of course, can very quickly lead to custom implementations of GetHashcode for objects added to the set.
    Good video all the same.

  • @ShivamSharma-sg7dk
    @ShivamSharma-sg7dk ปีที่แล้ว

    Great video. According to you, what are the most used methods for HashSets?

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

    thanks!

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

    ✨✨✨✨✨✨👍👍👍👍