• mjovanovictech Profile Picture

    Milan Jovanović @mjovanovictech

    3 years ago

    C# Tip 💡 How often do you use tuples in C#? Tuples allow you to define a lightweight data structure with ease. Some of the features of tuples you need to know are: • Value type • Deconstruction support • Strong typing • Item naming support

    mjovanovictech tweet picture

    12 25 152 12K 21
    Download Image
  • mjovanovictech Profile Picture

    Milan Jovanović @mjovanovictech

    3 years ago

    So here's a nice use case for tuples, which you can see in the image. Instead of defining out parameters, you can return multiple values from a method by creating a tuple.

    1 0 4 2K 0
  • maxx_don Profile Picture

    Massimiliano Donini @maxx_don

    3 years ago

    @mjovanovictech Every time I see a tuple used as a return type I cry a bit 😅

    0 0 3 113 0
  • Imadepeter2 Profile Picture

    Peetar @Imadepeter2

    3 years ago

    @mjovanovictech Thanks! Learnt something new today :)

    0 0 2 176 0
  • yur3tz Profile Picture

    Yuretz 🇺🇦🇩🇰 @yur3tz

    3 years ago

    @mjovanovictech When I decided I wasn't using tuples enough, I created this 😂github.com/yuretz/yTuple

    0 0 2 204 0
  • Universitetsle1 Profile Picture

    Opplett @Universitetsle1

    3 years ago

    @mjovanovictech I like to know that tuples exist, but to be honest, I feel that they give a bad smell to the code (e.g these fields should actually be encapsulated in a small class / object). Readability is also important. I guess I will only use tuples if it can solve performance issues.

    1 0 2 106 0
  • vyrotek Profile Picture

    Jason Barnes @vyrotek

    3 years ago

    @mjovanovictech Check out OneOf for more advanced scenarios that need type-safe switching on the result. github.com/mcintyre321/On…

    0 0 1 133 0
  • DustenSalinas Profile Picture

    Dusten Salinas @DustenSalinas

    3 years ago

    @mjovanovictech This was one of the primary language features that unlocked async and out variables for me. I use it on the regular! With these, you can do very succinct if statements as well with what was traditionally Try(.. out).

    0 0 1 119 0
  • valarion Profile Picture

    I @valarion

    3 years ago

    @mjovanovictech which version of c# is this?

    1 0 1 614 0
  • DigiBanks99 Profile Picture

    Wilco Boshoff 🦋 @DigiBanks99

    3 years ago

    @mjovanovictech I hate tuples. They make reading code very difficult. Only good use for them is in destructing for pattern matching

    0 0 0 117 0
  • Silver_8U Profile Picture

    Ulrich @Silver_8U

    3 years ago

    @mjovanovictech @YvanBrunel

    0 0 0 47 0
  • ale_poy Profile Picture

    Alessandro Poy @ale_poy

    3 years ago

    @mjovanovictech Why not records instead?

    1 0 0 83 0
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with X™. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro x profile viewer