The Top 10 Best New Features in C# Version 6 to 9, by Chris Klug



There are a lot of cool and usable new features being added to C#. However, way too many of us are too busy building stuff, and …

13 Comments

  1. Compressing code into single lines creates a concise complexity that looks very impressive to non-geeks. Super cryptic.
    But for real geeks, creating and disposing of a zillion temporary variables not only makes the code harder to read & digest, it also makes the code much more difficult to debug if something goes wrong.
    Readability and maintainability are important.
    You never now who is going to inherit your code…

  2. Amazing list, and extremely thorough and well-explained. I knew maybe 70% of them at most, so instant Suscribe. I have one that I remember discovering last year:
    if (myInterfaceObject is ImplementationA ImpA) { ImpA.DoStuffSpecificToImplementationA(); }

    I use this in Blazor for multiple test questions, that might have images, or audio, or various special features like drag and drop, but use the same scoring interface (elo adjustments and so on).

  3. There's no mention of local functions! That's my favourite feature since it allows you to compose complex methods into smaller units without polluting the class level scope.

  4. What's the advantage of default implementations over abstract classes?
    Seems to me there's a big disadvantage: interfaces can now have implementations…
    That increases complexity and readability of the code.

  5. Great video! One additional good use i have found for default interface methods is when you will have multiple implementations of the interface, but know they should have identical implementations for some of the functions. This will be great for blazor code where you should keep implementations for both server and client seperate, but also with minimal code

Leave a Reply

© 2023 53GB