Every feature added in C# 10 with examples

  Рет қаралды 124,438

Nick Chapsas

Nick Chapsas

Күн бұрын

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

Пікірлер: 166
@nickchapsas
@nickchapsas 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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: kzbin.info/www/bejne/np_YkHide7GCbck
@callindrill
@callindrill 2 жыл бұрын
Thanks. This was a great resource for learning about this feature!
@dcuccia
@dcuccia 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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?
@RoughSubset
@RoughSubset 2 жыл бұрын
Unless I've missed it in your videos, a video on Func and Action with practical use cases would also be great!
@nickchapsas
@nickchapsas 2 жыл бұрын
I have a video exactly like that scheduled within the next 2 weeks
@RoughSubset
@RoughSubset 2 жыл бұрын
@@nickchapsas Awesome, thank you!
@sallerc
@sallerc Жыл бұрын
@@nickchapsas What is the name of the video? Couldn't find it when searching through you videos
@Krzysztof20031997
@Krzysztof20031997 2 жыл бұрын
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 :)
@victorvandermilte5857
@victorvandermilte5857 2 жыл бұрын
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.
@petrusion2827
@petrusion2827 2 жыл бұрын
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!
@SPL1NTER_SE
@SPL1NTER_SE 2 жыл бұрын
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!
@lahcencodery
@lahcencodery 2 жыл бұрын
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#
@igorsentrxigorsentrx5550
@igorsentrxigorsentrx5550 2 жыл бұрын
'AssAndDeclaration' from feature 9. You are a master of naming! )
@MaxBenn
@MaxBenn 2 жыл бұрын
So I subscribed to many KZbinrs... You are the first one who got the Notificaton Bell... Great work! A ton of useful information in a short amount of time.
@mosth8ed
@mosth8ed 2 жыл бұрын
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. 👍
@maskettaman1488
@maskettaman1488 2 жыл бұрын
Incredible video. I was looking for something exactly like this
@longuinni
@longuinni 2 жыл бұрын
Really great video Nick! Thanks for sharing
@moe4b
@moe4b 2 жыл бұрын
Been waiting on generic attributes for sometime; good to see it implemented, now hoping for static indexers
@hoej
@hoej 2 жыл бұрын
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).
@janbodnar7815
@janbodnar7815 2 жыл бұрын
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 2 жыл бұрын
and Java still doesn't have async / await in 2021
@11clocky
@11clocky Жыл бұрын
Java has better enums, though.
@pemifo260
@pemifo260 Жыл бұрын
@@11clocky who uses enums?
@11clocky
@11clocky Жыл бұрын
@@pemifo260 I use them all the time. They are much better at representing a state than an int.
@pemifo260
@pemifo260 Жыл бұрын
@@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.)
@dmytroshchotkin2939
@dmytroshchotkin2939 2 жыл бұрын
Thanks a lot, Nick! A very nice overview.
@kerverse
@kerverse 2 жыл бұрын
Man! I Wish I knew your channel earlier amazing presentation and production quality you deserve many more subs bro! keep it up!
@Pedro5antos_
@Pedro5antos_ 2 жыл бұрын
Great language improvements! And great videos as always, Nick
@evanboltsis
@evanboltsis 2 жыл бұрын
Great content as always! Thanks Nick.
@joetrueman3555
@joetrueman3555 2 жыл бұрын
“Intendation”? ;) Great and informative vid, Nick… I watch every one of your videos … keep up the great work! :)
@TrowGundam
@TrowGundam 2 жыл бұрын
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 2 жыл бұрын
Same goes for the required keyword :(
@jankalfus42
@jankalfus42 2 жыл бұрын
Microsoft doesn't care about WPF. Sad, but true.
@jfpinero
@jfpinero 2 жыл бұрын
@@jankalfus42 Blazor WPF, Maui in .NET 6, do they really not care about WPF???
@infeltk
@infeltk 2 жыл бұрын
@@jankalfus42 And what instead?
@mariocamspam72
@mariocamspam72 Жыл бұрын
@@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
@ajonescouk
@ajonescouk 2 жыл бұрын
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.
@smithjohnson2709
@smithjohnson2709 2 жыл бұрын
You are amazing, thank you for your time and great explanation!!!
@mohammadjaber3898
@mohammadjaber3898 2 жыл бұрын
As usual, Great explanation 👍
@VandroiyIII
@VandroiyIII 2 жыл бұрын
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
@Fiilis1
@Fiilis1 2 жыл бұрын
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.
@AndrzejPauli
@AndrzejPauli 2 жыл бұрын
OMG, C# 9/10 is sooo similar to modern javascript :-) Loving it!!! BTW, great material Nick
@bezimienny5
@bezimienny5 2 жыл бұрын
You missed the perfectly valid opportunity to make "C# 10 features in 10 second" video ;D
@sindiinbonnienclyde
@sindiinbonnienclyde 2 жыл бұрын
Excellent video, thank you.
@paulecampbell
@paulecampbell 2 жыл бұрын
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.
@claudiopedalino337
@claudiopedalino337 2 жыл бұрын
Nice overview Nick, Thanks :) Question: Do you try api versioning into a minimal api? is it possible?
@easycodeunity3d14
@easycodeunity3d14 2 жыл бұрын
Thank you very much!
@heischono4917
@heischono4917 2 жыл бұрын
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 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 2 жыл бұрын
@@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 2 жыл бұрын
@@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". 😉
@JVimes
@JVimes Жыл бұрын
File scoped classes would also be great, possibly that get class name from file name.
@X39
@X39 2 жыл бұрын
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)
@mikolajsemeniuk8574
@mikolajsemeniuk8574 2 жыл бұрын
Great video, keep going.
@Handyzhang
@Handyzhang 2 жыл бұрын
great sharing, save my time, thanks very much!~
@jors3028
@jors3028 2 жыл бұрын
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.
@willinton06
@willinton06 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@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 2 жыл бұрын
It's the factory pattern, where this feature is super useful! CreateAsync is just another form of the factory pattern.
@ghkpr
@ghkpr 2 жыл бұрын
11:13 nice
@chezchezchezchez
@chezchezchezchez 2 жыл бұрын
Good job
@stefanbogdanovic590
@stefanbogdanovic590 2 жыл бұрын
Nick, can you make a video about Multithreading, locking deadlocks?
@LKD70
@LKD70 2 жыл бұрын
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...
@karlstenator
@karlstenator Жыл бұрын
1:31 - hey, how did you open up the XML via Solutions Explorer?
@nooftube2541
@nooftube2541 2 жыл бұрын
I’ve faced issue when the was need in partial class within the same file because of different usings (they were conflicting).
@gideonmaxmerling204
@gideonmaxmerling204 2 жыл бұрын
15:20 that is literally something I have tried to do but found out I couldn't, that's kinda funny
@sayedahmedanimation11
@sayedahmedanimation11 2 жыл бұрын
thanks
@ApacheGamingUK
@ApacheGamingUK 2 жыл бұрын
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 2 жыл бұрын
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.
@afouadr
@afouadr 2 жыл бұрын
Love it :-)
@DanielKierkegaardAndersen
@DanielKierkegaardAndersen 2 жыл бұрын
I know a few game engine devs who were wishing for the last feature :3 (static abstract interface implementations)
@BlueRaja
@BlueRaja 2 жыл бұрын
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.
@Elite7555
@Elite7555 2 жыл бұрын
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.
@sinkarq578
@sinkarq578 2 жыл бұрын
Hey, Nick! What Visual Studio Theme do you use in this video? Thanks in advance 😀
@nickchapsas
@nickchapsas 2 жыл бұрын
It’s a different IDE called JetBrains Rider
@roblyndon5267
@roblyndon5267 2 жыл бұрын
Arguably, var text = () => default(string) is more readable.
@DaveZeegers
@DaveZeegers 2 жыл бұрын
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.
@cdarrigo
@cdarrigo 2 жыл бұрын
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 2 жыл бұрын
I am using OBS Studio and I have a green screen and good lighting to chroma key the background out
@vladyslavhrehul2185
@vladyslavhrehul2185 2 жыл бұрын
Nick, would you make video about structs? Should we use them or not?
@codex4046
@codex4046 2 жыл бұрын
A video about structs, records and classes would be nice. The differences and when to use one over the other.
@protox4
@protox4 2 жыл бұрын
A good rule to go by: if you're not sure if you should use a class or a struct, use a class.
@parapadirapa
@parapadirapa 2 жыл бұрын
What's the shortest and quickest way to refactor the 'classic' Namespace to a File Scoped Namespace, desirably using keyboard shortcuts?
@nickchapsas
@nickchapsas 2 жыл бұрын
Rider has that in the quick actions menu Alt+Enter
@oskioskioski
@oskioskioski 2 жыл бұрын
What made you switch to Visual Studio from Rider?
@nickchapsas
@nickchapsas 2 жыл бұрын
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 2 жыл бұрын
@@nickchapsas fingers crossed, maybe it will be better when VS 2022 comes out in a few weeks?
@misha130
@misha130 2 жыл бұрын
So can we now have IoC with csproj?
@vintage8
@vintage8 2 жыл бұрын
Really, really, nobody commented about 420 or 69 at 11:25. I believe even Nick kinda got upset about that.
@KebunH
@KebunH 2 жыл бұрын
Oh I noticed straight away, in my work projects my unit tests are filled with these values
@kevindt100
@kevindt100 2 жыл бұрын
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 2 жыл бұрын
The field keyword was pushed to C# 11
@fredchuks7822
@fredchuks7822 2 жыл бұрын
Please, how do I call methods in csharp 10
@babri1402
@babri1402 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 2 жыл бұрын
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 2 жыл бұрын
Structs aren't immutable by default anyway.
@bigdogsmallman
@bigdogsmallman 2 жыл бұрын
Could you make videos on yaml pipelines?
@metacob
@metacob 2 жыл бұрын
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.
@antondoit
@antondoit 2 жыл бұрын
Great
@metaltyphoon
@metaltyphoon 2 жыл бұрын
You want to see why static abstract is useful, check how Rust implements operations on primitive types.
@arnabmondal5596
@arnabmondal5596 2 жыл бұрын
Isn't it something very similar to module concept on VB?? Just asking
@urbanelemental3308
@urbanelemental3308 2 жыл бұрын
Can you provide a better example of the pattern matching? I don't understand why you wouldn't just put if(rectangle.Height > 100) {}.
@wangengzheng8931
@wangengzheng8931 2 жыл бұрын
nice
@Anequit
@Anequit 2 жыл бұрын
Are you enjoying vs2022 or are you going to go back to rider?
@nickchapsas
@nickchapsas 2 жыл бұрын
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 2 жыл бұрын
@@nickchapsas Looking forward to that video :)
@matiaskloster9963
@matiaskloster9963 2 жыл бұрын
Do global usings reduce performance?
@jerrynothstine2926
@jerrynothstine2926 2 жыл бұрын
Usings are only used at compile time. May, possibly, slow down things while compiling but not runtime.
@user-cw6ie8sy8w
@user-cw6ie8sy8w Жыл бұрын
Why you turned off subtitles in this video guide?
@armanx2
@armanx2 2 жыл бұрын
I still need to learn the features from C# 9.... Things are moving too fast for me 🤕
@AveN7ers
@AveN7ers 2 жыл бұрын
Dat JavaScript influence
@teseract7442
@teseract7442 2 жыл бұрын
Hey Nick, can explan newtonsoft framework? please! thanks :)
@markusjohansson6245
@markusjohansson6245 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".
@dire_prism
@dire_prism 2 жыл бұрын
I wish C# could add much more support for const expressions.
@asdasddas100
@asdasddas100 2 жыл бұрын
Holy shit they added TypeClasses to C#
@CreamoftheCrop
@CreamoftheCrop 2 жыл бұрын
I'm just here to comment on the "AssAndDeclarationInSameDeconstruction"
@dalekman8945
@dalekman8945 2 жыл бұрын
Does anybody know what IDE this is? It doesn't look like rider👀
@ahmedtalaat27
@ahmedtalaat27 2 жыл бұрын
it's something weird to see something old in c++ is a new feature LOL
@ahmedtalaat27
@ahmedtalaat27 2 жыл бұрын
@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.
@reyreyalldayday5708
@reyreyalldayday5708 2 жыл бұрын
That function thing looks like es6 javascript
@KebunH
@KebunH 2 жыл бұрын
11:18 I see you’re a man of culture 😏
@ad9291
@ad9291 2 жыл бұрын
420, 69, all over the place :D
@bennymountain1
@bennymountain1 2 жыл бұрын
.NET 6, C# 9
@ad9291
@ad9291 2 жыл бұрын
@@bennymountain1 Mind, blown
@Mortizul
@Mortizul 2 жыл бұрын
Static abstract classes look like Monoids to me.
@Ozuqam
@Ozuqam 2 жыл бұрын
I think this is more elegant . var someFunc=()=> default(string?);
@Kantaros
@Kantaros 2 жыл бұрын
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 11 ай бұрын
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 11 ай бұрын
@@chrisroyle4813 that makes a lot of sense. I'm even tempted to steal this 😁
@Obyvvatel
@Obyvvatel 2 жыл бұрын
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 2 жыл бұрын
Yeah, now let's wait like 3 years untill it comes to Unity lol
@CabbageYe
@CabbageYe 2 жыл бұрын
String interpolation for const doesn't really make sense to me
@the-niker
@the-niker 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.
@alexvanheerden5702
@alexvanheerden5702 2 жыл бұрын
My like was the 69th, not that that is a special number or anything.
@Nekroido
@Nekroido 2 жыл бұрын
Nice
@ApacheGamingUK
@ApacheGamingUK 2 жыл бұрын
Nice
@ignisAnimus
@ignisAnimus 2 жыл бұрын
Who the hell disliked this video? :D
@lachee3055
@lachee3055 Жыл бұрын
Global using is gross, i cant believe that got approved.
@bies_moron4404
@bies_moron4404 8 ай бұрын
C# become complete garbage :( C# 6.0 were perfect btw
@shanehebert396
@shanehebert396 2 жыл бұрын
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 2 жыл бұрын
To the build process? Nothing noticable.
@robl39
@robl39 Жыл бұрын
Ref struct, record struct, record class, ValueTask, blah, blah. They are getting a little out of control IMO
@mortenbork6249
@mortenbork6249 2 жыл бұрын
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.
@doctor9101
@doctor9101 2 жыл бұрын
U must b hating java then
7 awesome improvements for LINQ in .NET 6
14:33
Nick Chapsas
Рет қаралды 213 М.
Every single feature added in C# 11
27:07
Nick Chapsas
Рет қаралды 109 М.
Do you like a chocolate surprise egg?🥚🍫🥰 #demariki
00:32
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 306 М.
The Only .NET Scheduler You Should Be Using!
16:38
Nick Chapsas
Рет қаралды 25 М.
5 New Features in C# 9 (not including Records)
1:11:00
IAmTimCorey
Рет қаралды 80 М.
The evolution of Pattern Matching in C# (from version 6 to 10)
16:08
Await Async Tasks Are Getting Awesome in .NET 9!
9:24
Nick Chapsas
Рет қаралды 79 М.
What's New in C# 12 | .NET Conf 2023
35:28
dotnet
Рет қаралды 52 М.