Every feature added in C# 10 with examples

Sdílet
Vložit
  • čas přidán 16. 06. 2024
  • Become a Patreon and get source code access: / nickchapsas
    Check out my courses: dometrain.com
    Keep coding merch: keepcoding.shop
    Hello everybody I'm Nick and in this videoI will show you every single feature added in C# 10.
    AsyncMethodBuilder example: gist.github.com/Horusiath/401...
    Timestamp:
    Intro - 0:00
    Global using statements - 0:17
    File scoped namespaces - 2:30
    Constant interpolated strings - 3:37
    Attributes support generics - 4:37
    Lambda improvements - 5:31
    Extended property patterns - 7:20
    Record structs - 8:35
    Record types can seal ToString() - 9:53
    Structure type improvements - 10:48
    Assignment and declaration in the same deconstruction - 11:53
    Allow AsyncMethodBuilder on async methods - 13:05
    Static abstract members in interfaces - 14:19
    Don't forget to comment, like and subscribe :)
    Social Media:
    Follow me on GitHub: bit.ly/ChapsasGitHub
    Follow me on Twitter: bit.ly/ChapsasTwitter
    Connect on LinkedIn: bit.ly/ChapsasLinkedIn
    #csharp #dotnet #csharp10

Komentáře • 167

  • @nickchapsas
    @nickchapsas  Před 2 lety +37

    Thank you so much everyone for pointing out usecases for static abstract members in interfaces. No idea how I missed it, since it's quite obvious but I'm so glad you could give me a hand wiht this one!

    • @talwald1680
      @talwald1680 Před 2 lety +1

      Async method builder allows to specify how to configure the state machine of the async method behind the scenes. Look at Microsoft's RC post - they show an example where they pool the task instances and improve the performance.
      About static members in interfaces - a lot of code in functional programming is repeated because there is no way to look at the shape of the type - including static members.
      Implementing map, reduce and filter is a great example, because the implementation of map on a collection, and on tasks, and async enumerables and option and more are pretty much the same, and the duplicate code can be totally eliminated with abstract members in interfaces.
      I recommend you look it up.
      Great video! I'm supper excited to use this in my own projects!!

    • @DeathxStrike18
      @DeathxStrike18 Před 2 lety

      The lambda with var = null causes an error because var could be a bool as there isnt a type to clarify to the compiler and bools can't be null they are binary. so by clarifyhing string before the lambda your telling that Var represents a string and only a string. Though honestly var should probably not be used as it leads to hard to read code the exception is where the type is clear such as var counter = 1 in this case its easy to tell its an int.

  • @valcron-1000
    @valcron-1000 Před 2 lety +43

    Static abstract members are Typeclasses from Haskell. When implementing an interface you need to extend from it in the class declaration (class X : Interface { }), but with this new feature you can extend classes which you don't control (like extension methods, but in a controlled manner). This goes WAY beyond "numerical" code.
    For example, a while ago I was working on an Android project that used the class "MediaMetadataRetriever". In order to use the "try-with-resources" construct, a class should implement the "AutoClosable" interface. The class didn't implement the interface until API 29. Even if the class conformed to the interface and I could recreate the behavior using it's public API the only option I had was to make a subclass that implements it. With Typeclasses I could easily extend the interface without needing to control the class implementation.
    I recommend watching this video from Mads Torgersen: czcams.com/video/hnu_EgFLO7g/video.html

    • @callindrill
      @callindrill Před 2 lety +1

      Thanks. This was a great resource for learning about this feature!

    • @dcuccia
      @dcuccia Před 2 lety +3

      I'd simply describe it as "inheritance-free contracts for static members." I will use this all over the place when swapping implementations of functions that don't need an instance, such as a configuration driven "option" or a fake for testing.

    • @ZipADeeeDoooDaaa
      @ZipADeeeDoooDaaa Před 2 lety +1

      Thank you so much. If it wasn't for your comment, I wouldn't have realized that this is the very feature I was hoping, waiting and searching for since c# 4.0. Every now and then i would look at the feature list and hope they implement something close to the golang interface mechanism. Finally it is here. :D

    • @ZipADeeeDoooDaaa
      @ZipADeeeDoooDaaa Před 2 lety +1

      After I played around with this feature, I sadly have to report that it is not there yet. There is one key thing missing to resemble Typeclasses from Haskell or interfaces from golang. For now there is no way to link the interface to an existing class ( e.g. extension IntExt : Int32, INumber { } ).
      So back to square one for me :(. I hope it will not take another 5+ years to get implemented.

    • @jfpinero
      @jfpinero Před 2 lety

      @@ZipADeeeDoooDaaa Just curious, why can't you create a class and derive it from Int32? If you need a new method in that class, why not create an extension method?

  • @petrusion2827
    @petrusion2827 Před 2 lety

    The last one is so amazing!! I've been waiting for something like this to be added, I'm seriously excited for this! It easily outshines the other changes, even though it is still in preview. The *with* keyword on structs as well as record structs are a close second - I already knew about those, but finding out we are getting what is pretty much Typeclasses has just really made my day, can't wait!

  • @Krzysztof20031997
    @Krzysztof20031997 Před 2 lety +18

    I love it that you if you don't know a mechanism you just say "I don't know it, but just wanted to tell you that something will be changed."! Thank you for presenting C# 10 features in this nutshell :)

  • @SPL1NTER_SE
    @SPL1NTER_SE Před 2 lety

    They did some really nice work on this version of C#. I particularly liked the decreased amount of nesting and clutter caused by namespaces and using statements. I feel like this is revolutionary in terms of code-overview in C#!
    Great video by the way, I subscribed!

  • @victorvandermilte5857
    @victorvandermilte5857 Před 2 lety +5

    So happy about the static abstract members. This is something that has been bugging me for years. I have needed this feature many times and no language ever seemed to have it.
    Without this functionality, if you want a class family to have common fields with hardcoded values, but with different values for each subclass, you have to instantiate the class before you can access the hardcoded fields. Now you can just call it statically from the subclass. I feel like I often want this functionality when associating enums with subclasses. You can also enforce singletons in a class hierarchy with this.

  • @lahcencodery
    @lahcencodery Před 2 lety +1

    I've been coding in Typescript only for the last 6 months, came here to check on my favortie language and your video made me keen to get back to C#

  • @maskettaman1488
    @maskettaman1488 Před 2 lety +1

    Incredible video. I was looking for something exactly like this

  • @MaxBenn
    @MaxBenn Před 2 lety

    So I subscribed to many CZcamsrs... You are the first one who got the Notificaton Bell... Great work! A ton of useful information in a short amount of time.

  • @longuinni
    @longuinni Před 2 lety

    Really great video Nick! Thanks for sharing

  • @dmytroshchotkin2939
    @dmytroshchotkin2939 Před 2 lety

    Thanks a lot, Nick! A very nice overview.

  • @Pedro5antos_
    @Pedro5antos_ Před 2 lety

    Great language improvements!
    And great videos as always, Nick

  • @evanboltsis
    @evanboltsis Před 2 lety

    Great content as always! Thanks Nick.

  • @hoej
    @hoej Před 2 lety

    Great video! My favourite is Filescode namespaces, it'll just make every day work so much nicer.
    A quick tip on VS and SMSS (and some other editors/IDEs that want the same keybindings): Ctrl+K, C comments code (line if nothing is marked, marked code otherwise), Ctrl+K, U uncomments code (active cursor location and out).

  • @RoughSubset
    @RoughSubset Před 2 lety +50

    Unless I've missed it in your videos, a video on Func and Action with practical use cases would also be great!

    • @nickchapsas
      @nickchapsas  Před 2 lety +49

      I have a video exactly like that scheduled within the next 2 weeks

    • @RoughSubset
      @RoughSubset Před 2 lety +2

      @@nickchapsas Awesome, thank you!

    • @sallerc
      @sallerc Před rokem

      @@nickchapsas What is the name of the video? Couldn't find it when searching through you videos

  • @mosth8ed
    @mosth8ed Před 2 lety +1

    The abstract members in an interface, I was just wishing the other day I could do that in a game I have been working on. Nice to see that I will soon be able to. 👍

  • @kerverse
    @kerverse Před 2 lety

    Man! I Wish I knew your channel earlier amazing presentation and production quality
    you deserve many more subs bro!
    keep it up!

  • @moe4b
    @moe4b Před 2 lety +1

    Been waiting on generic attributes for sometime; good to see it implemented, now hoping for static indexers

  • @janbodnar7815
    @janbodnar7815 Před 2 lety +25

    For me, the file scoped namespaces, global usings & lambda improvements are the greatest additions to the language. The only thing that Java language had better than C# was the package system; now with file scoped namespaces, I declare the Java language officially defeated. Everywhere, the C# syntax is now cleaner, shorter & more powerful. (Note that this is relevant to the Java as the language, the ecosystem has Clojure & Groovy languages which are both great.)

    • @TodorKatsarski
      @TodorKatsarski Před 2 lety +2

      and Java still doesn't have async / await in 2021

    • @11clocky
      @11clocky Před rokem

      Java has better enums, though.

    • @pemifo260
      @pemifo260 Před rokem

      @@11clocky who uses enums?

    • @11clocky
      @11clocky Před rokem

      @@pemifo260 I use them all the time. They are much better at representing a state than an int.

    • @pemifo260
      @pemifo260 Před rokem

      @@11clocky can you provide some examples? yes i agree with you enums represent states better than int but in my codes i don't represent states that much (likely never to rare.)

  • @smithjohnson2709
    @smithjohnson2709 Před 2 lety

    You are amazing, thank you for your time and great explanation!!!

  • @igorsentrxigorsentrx5550

    'AssAndDeclaration' from feature 9.
    You are a master of naming! )

  • @mohammadjaber3898
    @mohammadjaber3898 Před 2 lety

    As usual, Great explanation 👍

  • @joetrueman3555
    @joetrueman3555 Před 2 lety

    “Intendation”? ;)
    Great and informative vid, Nick… I watch every one of your videos … keep up the great work! :)

  • @mikolajsemeniuk8574
    @mikolajsemeniuk8574 Před 2 lety

    Great video, keep going.

  • @sindiinbonnienclyde
    @sindiinbonnienclyde Před 2 lety

    Excellent video, thank you.

  • @ajonescouk
    @ajonescouk Před 2 lety

    Great video as always and thank you. Just taking some time to blow some smoke up your backside: it's really refreshing to hear on the last point, "I can't think of a use for this let me know if you can..." it's the tendency of a lot of big programming YTers to be incredibly patronising and thinking they have to know everything. I'm only amateur but find a lot of channels talk down to their viewers even on complex subjects. Your approach is much more level-headed and you don't talk down to your viewers which I appreciate and will cause me to continue watching and staying subbed. Cheers.

  • @AndrzejPauli
    @AndrzejPauli Před 2 lety

    OMG, C# 9/10 is sooo similar to modern javascript :-) Loving it!!!
    BTW, great material Nick

  • @VandroiyIII
    @VandroiyIII Před 2 lety +1

    I'm happy to see F# features still flowing to C# by the bucket. Can't wait to have them back while working with C#. :)
    Static abstract might even be better in some cases than the explicit inlining chaos F# has been using.
    Now do type providers and tail recursion and units of measure. lol

  • @easycodeunity3d14
    @easycodeunity3d14 Před 2 lety

    Thank you very much!

  • @Handyzhang
    @Handyzhang Před 2 lety

    great sharing, save my time, thanks very much!~

  • @paulecampbell
    @paulecampbell Před 2 lety +1

    Nick you the boss!!! You're videos are hands down the best! Please consider creating some Pluralsight or Udemy courses. They would "sell off" as we'd say here in Jamaica.

  • @TrowGundam
    @TrowGundam Před 2 lety +26

    I'm disappointed the "field" keyword for properties didn't make the cut for C# 10. It would have let me get rid of so much cookie cutter code when I work WPF.

    • @nickchapsas
      @nickchapsas  Před 2 lety +5

      Same goes for the required keyword :(

    • @jankalfus42
      @jankalfus42 Před 2 lety +7

      Microsoft doesn't care about WPF. Sad, but true.

    • @jfpinero
      @jfpinero Před 2 lety

      @@jankalfus42 Blazor WPF, Maui in .NET 6, do they really not care about WPF???

    • @infeltk
      @infeltk Před 2 lety

      @@jankalfus42 And what instead?

    • @mariocamspam72
      @mariocamspam72 Před rokem

      @@jfpinero They really don't. WPF has been practically abandoned by MS, only receiving small patches from the **community**. The tooling is gradually becoming more broken as we get more awesome helper packages and complex functionality

  • @claudiopedalino337
    @claudiopedalino337 Před 2 lety

    Nice overview Nick, Thanks :)
    Question: Do you try api versioning into a minimal api? is it possible?

  • @JVimes
    @JVimes Před rokem +1

    File scoped classes would also be great, possibly that get class name from file name.

  • @jors3028
    @jors3028 Před 2 lety +1

    C# 10 has really great code-reducing features, however, the static abstract members feature ups the game. Yes, it does allow for something like strong units does in F#, however, it also gives you a way to implement a Factory Pattern without having to declare a separate class. This means, one less level of complexity, and factories really make it easier to use immutable types, which means less bugs and easier-to-use libraries.

  • @chezchezchezchez
    @chezchezchezchez Před 2 lety

    Good job

  • @Fiilis1
    @Fiilis1 Před 2 lety

    Man this youtube surfing is full of mystery, first I am watching diaper fashion video and next I am watching coding. I'll keep going, wonder where I end from here.

  • @bezimienny5
    @bezimienny5 Před 2 lety

    You missed the perfectly valid opportunity to make "C# 10 features in 10 second" video ;D

  • @X39
    @X39 Před 2 lety

    That static interface thingy is ac hellalot of awesome but only really useful whenever you work with generics. Had the need for it a lot already, love they finally added it (next please stack allocated arrays and eg. Constants as generic parameters please @c#)
    Main usecase is hard to explain until you come across that kind of nightmarish (in c# at least) usecase, having to use factory classes or reflection and extensive caching to solve
    Regarding the async method builder attribute, cannot really share anything regarding what or how it exactly works as I did not upgraded the code of that part at work yet, but it is essentially for building custom tasks (which was a nightmare in the past with loads of compiler magic functions and behavior, AFAIK that should change that), researching into it is quite likely to yield great results (eg. Got a custom promise that allows to await events that rely eg. On the user. Allows loads of way nicer code)

  • @willinton06
    @willinton06 Před 2 lety +5

    Nick I’m sure you have seen cases where abstract members in interfaces would be useful, maybe in an async creation pattern? As in, a class that requires some async behavior to be initialized, but you can’t put it in a constructor so you use a static method CreateAsync, that returns a task of the object, now that could be on an interface and mixed with generics to cleanup lots of repetitive code.
    And generic math is just cool

    • @nickchapsas
      @nickchapsas  Před 2 lety

      I would never think to put that on the interface for a couple of reasons. It is really rare that I would need some async initialization and if I ever did I would do that as part of DI.

    • @willinton06
      @willinton06 Před 2 lety

      @@nickchapsas that’s the usual way I go for it, but in this one case I had to go for the CreateAsync pattern for a long ass reason and it would have been nice to put that behind an interface

    • @protox4
      @protox4 Před 2 lety +1

      It's the factory pattern, where this feature is super useful! CreateAsync is just another form of the factory pattern.

  • @sayedahmedanimation11
    @sayedahmedanimation11 Před 2 lety

    thanks

  • @heischono4917
    @heischono4917 Před 2 lety

    Thank you @Nick for all your videos. I have seen multiple videos in the last few days, and I must say: as a non-native English person, I sometimes don't understand what you say. You have an enormous speed, that surely is ok for the most of viewers. But these are "tutorials for every level", should you think about, that the entry levels perhaps have a problem with the speed of both presentation and speech? I remember one video, where you overlaid text - it was just impossible to read the text completely :( Yes, I know about a pause function, but this shouldn't be necessary.)
    Again, thank you for your work, the content is very useful!!! But I must wait to become a patreon, because I sometimes just give up ... Greetings from a German, living in Norway :)

    • @nickchapsas
      @nickchapsas  Před 2 lety +2

      Hello there 👋. If I am talking too fast then you can slow me down by using the speed playback feature. Unfortunately I don’t think that my videos are for entry level engineers but rather intermediate to advanced. The majority of the audience prefers the fast pace rather the slow one. There are other creators, like Tim Corey, that you might find easier to follow. Ultimately I am making content that I would like to watch myself. Greetings from a Greek living in London.

    • @heischono4917
      @heischono4917 Před 2 lety

      @@nickchapsas I will give the speed playback feature a try. I know Tim Coreys videos, and there I think it is too much 'overhead', compared with your content. Something in the middle would be perfect, but as long as I haven't found 'something in the middle', I think I will prefer your videos in the most of cases 😁

    • @heischono4917
      @heischono4917 Před 2 lety

      @@nickchapsas wrote: "Unfortunately I don’t think that my videos are for entry level engineers but rather intermediate to advanced."
      Your Patreon banner says "... tutorials for every level". 😉

  • @BlueRaja
    @BlueRaja Před 2 lety

    Interestingly, I suggested file-scoped namespaces (and file-scoped class declarations) 12 years ago on the old C# suggestion tracker. Their response was that this would not be a useful feature.

  • @ghkpr
    @ghkpr Před 2 lety +1

    11:13 nice

  • @Elite7555
    @Elite7555 Před 2 lety

    I like the idea of global usings in the .proj file. However, I certainly don't like some random .cs file having them.
    Fibers are a really neat addition! Fibers are essentially "green threads", something like go-routines. They also work co-cooperatively; however, they aren't guaranteed to run in the same thread.
    Static abstract members are indeed very niche, and most likely they're only really useful to make overloaded operators available to generic functions. *However*, that's actually really, really neat.

  • @afouadr
    @afouadr Před 2 lety

    Love it :-)

  • @antondoit
    @antondoit Před 2 lety

    Great

  • @stefanbogdanovic590
    @stefanbogdanovic590 Před 2 lety

    Nick, can you make a video about Multithreading, locking deadlocks?

  • @DanielKierkegaardAndersen

    I know a few game engine devs who were wishing for the last feature :3 (static abstract interface implementations)

  • @roblyndon5267
    @roblyndon5267 Před 2 lety +2

    Arguably, var text = () => default(string) is more readable.

    • @DaveZeegers
      @DaveZeegers Před 2 lety +1

      I personally can argue that Function is way better as var. In my opinion every developer tries to be lazy. When im reading code from someone else it mostly consists of var x = "bleh". Which makes me need to think about what kind of class x is. Why not keep it type specific also in code. Everyone should stop using var if it would be up to me.
      I don't think ability using var in any situation makes it more readable or less cluttered as the author of this video explains. In my opinion these are additions for the "lazy" programmer not to define things. But make them less readable for any third party.

  • @sinkarq578
    @sinkarq578 Před 2 lety

    Hey, Nick! What Visual Studio Theme do you use in this video? Thanks in advance 😀

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      It’s a different IDE called JetBrains Rider

  • @ApacheGamingUK
    @ApacheGamingUK Před 2 lety

    With the static abstract interfaces, would this allow you to perform mathematical operations in generic methods, if the constraints are set with these static abstract interfaces? It'd be really handy for vector and matrix functions, where you currently need overloads for vectors of ints, floats, and doubles, with the exact same functionality in each. Having a Vec3, instead of a Vec3f, Vec3d, and Vec3i, would be hugely beneficial. We still have no INumerical interface or equivalent constraint. This could offer a solution, or at the very least, reduce the clutter for any jury rigged workaround.

    • @connorboyle2092
      @connorboyle2092 Před 2 lety

      Actually, we do have such a constraint as part of .NET 6 (set LangVersion to preview) that uses the static abstract members. INumber is what you probably want, but there is also more specific interfaces like IMultiplyOperators, IComparisonOperators, IFloatingPoint, etc.

  • @gideonmaxmerling204
    @gideonmaxmerling204 Před 2 lety

    15:20
    that is literally something I have tried to do but found out I couldn't, that's kinda funny

  • @wangengzheng8931
    @wangengzheng8931 Před 2 lety

    nice

  • @metaltyphoon
    @metaltyphoon Před 2 lety

    You want to see why static abstract is useful, check how Rust implements operations on primitive types.

  • @cdarrigo
    @cdarrigo Před 2 lety

    Nick what program do you use to broadcast your screen in overlay your head in the corner? I have to record some training videos for work, and I'd love to use a similar setup. In the past I've tried to record video on my screen but when it renders it's largely unreadable

    • @nickchapsas
      @nickchapsas  Před 2 lety +1

      I am using OBS Studio and I have a green screen and good lighting to chroma key the background out

  • @LKD70
    @LKD70 Před 2 lety

    does VS have an option to follow a definition? For example if you were to select JsonSerializer and follow its definition it could direct you to where the 'System.Text.Json' is imported?
    Would resolve the issue of being unaware of which libraries are used and where from, etc...

  • @kevindt100
    @kevindt100 Před 2 lety

    I don't know if its a C# 10 Feature or a .Net 6. But the new field keyword can be very nice to use. It makes a lot of code become a lot less.

    • @nickchapsas
      @nickchapsas  Před 2 lety

      The field keyword was pushed to C# 11

  • @vintage8
    @vintage8 Před 2 lety +2

    Really, really, nobody commented about 420 or 69 at 11:25.
    I believe even Nick kinda got upset about that.

    • @KebunH
      @KebunH Před 2 lety

      Oh I noticed straight away, in my work projects my unit tests are filled with these values

  • @karlstenator
    @karlstenator Před 2 lety

    1:31 - hey, how did you open up the XML via Solutions Explorer?

  • @metacob
    @metacob Před 2 lety

    File-scoped namespaces. I can finally (and trivially) remove one indentation level in literally 99.999% of my code (and that 0.001% was just due to laziness, I can remove it there too). It's literally free (horizontal) real-estate.

  • @vladyslavhrehul2185
    @vladyslavhrehul2185 Před 2 lety +12

    Nick, would you make video about structs? Should we use them or not?

    • @codex4046
      @codex4046 Před 2 lety +9

      A video about structs, records and classes would be nice. The differences and when to use one over the other.

    • @protox4
      @protox4 Před 2 lety

      A good rule to go by: if you're not sure if you should use a class or a struct, use a class.

  • @nooftube2541
    @nooftube2541 Před 2 lety

    I’ve faced issue when the was need in partial class within the same file because of different usings (they were conflicting).

  • @kirillzlobin7135
    @kirillzlobin7135 Před měsícem

    5:32 - lamda improvements. Does it make Func, Actions and I guess something else obsolete?

  • @parapadirapa
    @parapadirapa Před 2 lety

    What's the shortest and quickest way to refactor the 'classic' Namespace to a File Scoped Namespace, desirably using keyboard shortcuts?

    • @nickchapsas
      @nickchapsas  Před 2 lety

      Rider has that in the quick actions menu Alt+Enter

  • @babri1402
    @babri1402 Před 2 lety +2

    I am a bit confused about why they introduced record structs, it just makes it very confusing.
    Records were supposed to be immutable version of class. Now we have record structs that are actually mutable. Secondly now that we have record structs, why should one use structs instead of record structs or vice versa?

    • @nickchapsas
      @nickchapsas  Před 2 lety

      Actually records could always have mutable elements. Think of them as data classes with some immutability first logic, but that's about it. Both record classes and record structs can have mutable elements, that doesn't change. Using record structs over structs are, again, a matter of usecase and preference. Do you have a struct that just have a few immutable properties and a constructor? Make it a record. Is it more complicated than that? Then maybe use a simple struct.

    • @carlinhos10002
      @carlinhos10002 Před 2 lety

      Structs aren't immutable by default anyway.

  • @dire_prism
    @dire_prism Před 2 lety

    I wish C# could add much more support for const expressions.

  • @bigdogsmallman
    @bigdogsmallman Před 2 lety

    Could you make videos on yaml pipelines?

  • @oskioskioski
    @oskioskioski Před 2 lety +1

    What made you switch to Visual Studio from Rider?

    • @nickchapsas
      @nickchapsas  Před 2 lety +6

      I haven't. I'm only using it because Rider doesn't support all the C# 10 features yet. The moment it does I will switch back. I am not having fun at all with VS.

    • @sheveksmath702
      @sheveksmath702 Před 2 lety +1

      @@nickchapsas fingers crossed, maybe it will be better when VS 2022 comes out in a few weeks?

  • @asdasddas100
    @asdasddas100 Před 2 lety

    Holy shit they added TypeClasses to C#

  • @misha130
    @misha130 Před 2 lety

    So can we now have IoC with csproj?

  • @urbanelemental3308
    @urbanelemental3308 Před 2 lety

    Can you provide a better example of the pattern matching? I don't understand why you wouldn't just put if(rectangle.Height > 100) {}.

  • @markusjohansson6245
    @markusjohansson6245 Před 2 lety +2

    Thanks for nice video. I have a general reflection on all the c# versions. Its getting really messy. I work at a place where we have like 50 microservices written in c#. There is no time (and would be waste of time) to constanly update to the latest versions. So as a developer you need to keep track of what version you are in. Sometimes the feature is not available so you have to go back to a earlier version of doing this. I have been working with c# since 2005 so Im ok, In know how to do everything in .net 1.1, but I cant imagine how a new developer would cope with this "mess".

  • @Anequit
    @Anequit Před 2 lety +1

    Are you enjoying vs2022 or are you going to go back to rider?

    • @nickchapsas
      @nickchapsas  Před 2 lety +10

      VS is fine but I can't wait for Rider to have full C# 10 support. Everything just slows me down and there are quite a few things I am missing. It is not a bad IDE but my experience can be summarized as "Death by a thousand cuts". I feel like Rider respects me and my time/productivity as a developer more. When both IDEs have their full releases I will make a video talking about it.

    • @Anequit
      @Anequit Před 2 lety

      @@nickchapsas Looking forward to that video :)

  • @KebunH
    @KebunH Před 2 lety

    11:18 I see you’re a man of culture 😏

  • @armanx2
    @armanx2 Před 2 lety +1

    I still need to learn the features from C# 9.... Things are moving too fast for me 🤕

  • @ahmedtalaat27
    @ahmedtalaat27 Před 2 lety

    it's something weird to see something old in c++ is a new feature LOL

    • @ahmedtalaat27
      @ahmedtalaat27 Před 2 lety

      @Oddik Aro Use boost advanced tasks but there is particular situations you cant even use async in c# or tasks in c++ ex: sockets. you need to use it in outside process.

  • @fredchuks7822
    @fredchuks7822 Před 2 lety

    Please, how do I call methods in csharp 10

  • @arnabmondal5596
    @arnabmondal5596 Před 2 lety

    Isn't it something very similar to module concept on VB?? Just asking

  • @ad9291
    @ad9291 Před 2 lety +4

    420, 69, all over the place :D

  • @AveN7ers
    @AveN7ers Před 2 lety

    Dat JavaScript influence

  • @CreamoftheCrop
    @CreamoftheCrop Před 2 lety

    I'm just here to comment on the "AssAndDeclarationInSameDeconstruction"

  • @matiaskloster9963
    @matiaskloster9963 Před 2 lety

    Do global usings reduce performance?

    • @jerrynothstine2926
      @jerrynothstine2926 Před 2 lety

      Usings are only used at compile time. May, possibly, slow down things while compiling but not runtime.

  • @user-cw6ie8sy8w
    @user-cw6ie8sy8w Před rokem

    Why you turned off subtitles in this video guide?

  • @teseract7442
    @teseract7442 Před 2 lety

    Hey Nick, can explan newtonsoft framework? please! thanks :)

  • @Ozuqam
    @Ozuqam Před 2 lety

    I think this is more elegant .
    var someFunc=()=> default(string?);

  • @reyreyalldayday5708
    @reyreyalldayday5708 Před 2 lety

    That function thing looks like es6 javascript

  • @Mortizul
    @Mortizul Před 2 lety

    Static abstract classes look like Monoids to me.

  • @Kantaros
    @Kantaros Před 2 lety

    I'm rather perplexed by global usings.
    Yeah, sure, you probably want to put System and System.Collections.Generic in every single file in your solution, but it seems kind of pointless for more niche/specialized namespaces.

    • @chrisroyle4813
      @chrisroyle4813 Před rokem +1

      We try and contain our company extension methods within the same namespaces per library e.g. Abc.Xpo.ExtensionMethod. Putting these into global usings will be a timesaver for us.

    • @Kantaros
      @Kantaros Před rokem +1

      @@chrisroyle4813 that makes a lot of sense. I'm even tempted to steal this 😁

  • @dalekman8945
    @dalekman8945 Před 2 lety

    Does anybody know what IDE this is? It doesn't look like rider👀

  • @Obyvvatel
    @Obyvvatel Před 2 lety

    Oh wow generic way of doing arithmetic, now I'll be able to make generics with a type restriction for things that have a + and - operators.

  • @Obyvvatel
    @Obyvvatel Před 2 lety

    Yeah, now let's wait like 3 years untill it comes to Unity lol

  • @alexvanheerden5702
    @alexvanheerden5702 Před 2 lety +1

    My like was the 69th, not that that is a special number or anything.

  • @ignisAnimus
    @ignisAnimus Před 2 lety +1

    Who the hell disliked this video? :D

  • @lachee3055
    @lachee3055 Před rokem

    Global using is gross, i cant believe that got approved.

  • @CabbageYe
    @CabbageYe Před 2 lety +1

    String interpolation for const doesn't really make sense to me

    • @the-niker
      @the-niker Před 2 lety +2

      It means you can now use string interpolation in Attributes, because they require a const value. Imagine [MyHandler(Name = $"{nameof(MyClass)}Handler")] . There are other uses, I'm pretty sure I bumped against this limitation a couple of times and had to work around it in uglier way, just can't remember the specifics.

  • @robl39
    @robl39 Před rokem +1

    Ref struct, record struct, record class, ValueTask, blah, blah. They are getting a little out of control IMO

  • @bies_moron4404
    @bies_moron4404 Před 10 měsíci

    C# become complete garbage :(
    C# 6.0 were perfect btw

  • @shanehebert396
    @shanehebert396 Před 2 lety +1

    You know that global usings is going to be abused. How much time will it add to the build process when there are a lot of global usings? ;)

    • @nickchapsas
      @nickchapsas  Před 2 lety +6

      To the build process? Nothing noticable.

  • @mortenbork6249
    @mortenbork6249 Před 2 lety

    I dont agree with your love of var usage and inference from actions and functions.
    Having the type defined, eases the readability of the code.
    This seems like an attempt to obfuscate code.
    Code you should read as a sentence, easy to grasp.
    And while it can be subjective, I don't believe it is in this case.
    Func test = () => "Some text";
    and
    var test = () => "Some text"
    while takes a tiny bit less spass, also completely removes understanding.
    if your "result" isn't a declared constant , but a method, then the return is defined inside the method, and you are deliberately hiding the returned object via var, making the code harder to read.
    Not to mention the horror that is:
    var text = string? () => null;
    why would you not write:
    string? text = () => null;
    I hate that they permitted this.