Awesome new features in C# 13 for .NET 9!

  Рет қаралды 13,515

Ed Andersen

Ed Andersen

Күн бұрын

Пікірлер: 77
@edandersen
@edandersen 2 ай бұрын
Who got "Who's that MVP?" right? 😊 Also, this can't be a podcast because the audio quality is so bad. So there. (use the subtitles / CC)
@luckyknot
@luckyknot 2 ай бұрын
just use an audio preset in your video editor to apply some subtractive eq on the lowend and a bit of compression.
@edandersen
@edandersen 2 ай бұрын
what does that even mean lol
@luckyknot
@luckyknot 2 ай бұрын
@@edandersen what software you use for your video editing?
@TheRubiosMusic
@TheRubiosMusic 2 ай бұрын
The song in the beginning had me laughing like a crazy person! Awesome content. I see (or hear) nothing wrong with the audio!
@edandersen
@edandersen 2 ай бұрын
@@luckyknot A mixture of OBS and Davinci Resolve
@keyser456
@keyser456 2 ай бұрын
Partial classes are great for code generation. A way to add on functionality where you don't want to put code in a .cs file that might get clobbered / regenerated (think EF Scaffolding, POCOs, TT4, etc.). Most those classes generated in that paradigm are created as partial for exactly that reason. :)
@edandersen
@edandersen 2 ай бұрын
Very true! Thanks for the comment!
@ubudubu100
@ubudubu100 Ай бұрын
Ok, partial classes are useful, I agree. But what is the usage of partial properties or methods?
@keyser456
@keyser456 Ай бұрын
@@ubudubu100 That, I haven't figured out yet. It looks (and feels) really wonky. It's almost like abstract methods in abstract classes or even interface methods, but why partial? This was the first I had even seen that syntax. Solution looking for a problem, maybe?
@edandersen
@edandersen Ай бұрын
@@keyser456 more like "someone's performance review is coming up and they need to shoehorn something in"
@j3k2006
@j3k2006 Ай бұрын
Partial properties could also be for code generation for overriding properties, rather than just adding properties? You're also tied to partial classes if you use partial properties...
@obinnaokafor6252
@obinnaokafor6252 2 ай бұрын
allow ref struct is another amazing feature of C# 13 and .NET 9
@alexanderrasch6053
@alexanderrasch6053 2 ай бұрын
Nice video as always, but when will C# slow down and give use longer LTS versions q_q 5 year plz
@SirBenJamin_
@SirBenJamin_ 2 ай бұрын
[ ] for collections initialisers or empty collections was such a huge addition for me (think it was c#12), so much less clutter and de-noising of your code. Wish they had done it ages ago. Btw, what platforms will your podcast be available on?
@edandersen
@edandersen 2 ай бұрын
Yeah that was a pretty good one. Thanks for the comment!
@georgehelyar
@georgehelyar 2 ай бұрын
So far I have found collection initialisers pretty bad at infering the type. Occasionally I get an analyser moan at me to change to collection initialiser syntax but when l actually want to use it then usually it tells me that it can't work out what type to use, making it a bit inconsistent and underwhelming.
@SirBenJamin_
@SirBenJamin_ Ай бұрын
@@georgehelyar hmm, not had that, but I only really use them for simple types.
@robinheyer708
@robinheyer708 Ай бұрын
It really depends on how much you use var in the code. If you strongly type the collections you're going to have a much better time. List
@user-lk1hg9ev5u
@user-lk1hg9ev5u Ай бұрын
Appreciate the share! a question: why win10 and not win11 or linux (Rider)?
@edandersen
@edandersen Ай бұрын
Just prefer it as a virtual machine :-) thanks for the comment!
@user-lk1hg9ev5u
@user-lk1hg9ev5u Ай бұрын
​@@edandersen any technical reasons :) ? I miss the win 10 outlook and feel and performance, and I hate win11 however I like its features..
@edandersen
@edandersen Ай бұрын
@@user-lk1hg9ev5u taskbar on the top, no TPM requirement for VMs
@juleseastlondoncockney8131
@juleseastlondoncockney8131 2 ай бұрын
I think the argument for MAUI is code reuse and productivity over maximum performance, native look and feel. If your app is for internal use or you have limited developer resources then MAUI and Blazor hybrid can make a lot of sense. This can be especially true for MVP.
@edandersen
@edandersen 2 ай бұрын
That's fair! the equation is changing though.
@SirBenJamin_
@SirBenJamin_ Ай бұрын
Bit of a side question. If you were going to move to another company, what is the minimum. NET version you'd be happy to consider?
@edandersen
@edandersen Ай бұрын
4.8.2 is fine. No Blazor or Razor Pages ;-)
@keyser456
@keyser456 2 ай бұрын
For brevity, why would we not use a collection initializer in C# 12? var subsList = new SubscriberList([ "Barry", "Larry" ]);
@edandersen
@edandersen 2 ай бұрын
This one is even shorter! No square brackets lol
@keyser456
@keyser456 2 ай бұрын
@@edandersen Tis true. I don't know about you but I've always disliked the "params" keyword. Feels unnatural to me. But I agree with your overall sentiment that it appears they're really scraping the bottom of the barrel for new language features.
@edandersen
@edandersen 2 ай бұрын
@@keyser456 not sure why they don't just make typescript run on the CLR. That was the point of the CLR, multiple language support. Not to turn C# into every single language all at once
@keyser456
@keyser456 2 ай бұрын
​@edandersen I could not agree more. They switched to this blisteringly fast release schedule and within just a few releases the language was almost unrecognizable. So many syntaxes to accomplish the same thing. You can't learn just one since who knows what your fellow devs will use.
@Kitulous
@Kitulous Ай бұрын
​@@edandersentypescript is not meant to be run on CLR, it's a type checker for JavaScript, so it's supposed to be run where JavaScript is run, and that includes web browsers. and c sharp cannot be run in web browsers.
@abdullahleghari
@abdullahleghari 2 ай бұрын
Some day C# will have all features a programming language can have :)
@yourcrazybear
@yourcrazybear 2 ай бұрын
With hundreds of ways to do the same thing? 🤣
@abdullahleghari
@abdullahleghari 2 ай бұрын
​@@yourcrazybear we're long past that point. Only C++ is serious rival.
@emptycode1782
@emptycode1782 Ай бұрын
​Lmao thats a good comment , i really hate that about C#, where is the simplicity and conciseness ? This also make it harder for beginners to get into it. @@yourcrazybear
@BarrySlisk-g6v
@BarrySlisk-g6v Ай бұрын
Yeah, it's sad!
@BarrySlisk-g6v
@BarrySlisk-g6v Ай бұрын
@@emptycode1782 What happened to the fact that the time spent coding is much less than time spent thinking? But still they add "features" to save us a few seconds of typing! Fucking lame! But the cost is a much more complex language!
@RocketC0de
@RocketC0de Ай бұрын
Thank you for this video, very informative!
@devpitch
@devpitch Ай бұрын
I agree with most of it, but learning another language means also learning tools and APIs which is time consuming. It's still may be worth it, but for a single developer?
@edandersen
@edandersen Ай бұрын
I think at this point you shouldn't pigeonhole yourself too much. LLMs let you be a lot more flexible if you have the core skills. Thanks for the comment!
@devpitch
@devpitch Ай бұрын
@@edandersen I generally agree with you. It's time to prepare. But after peaking at 15 languages and GitCoPilot, I can't say LLM can help me be productive just yet in other than in my core area like C#/Javascript. I am banking on more languages like J2 in 10 years.
@Hannes7046
@Hannes7046 Ай бұрын
Thanks, the best podcast I have watched for some time! 😃
@edandersen
@edandersen Ай бұрын
noooo it's not a podcast!!! (thanks for the comment!)
@Shagidelic
@Shagidelic 2 ай бұрын
What I really hate about. Net way is that it adds unnecessary stuff for ease, then adds more on top of it to make the new feature even more simpler.. and before you know it we have introduced 12 new syntaxes just to save a bit of typing. Example, set/getField() was too much so props were added (this could'vebeen done by autogen code), properties definition syntax added its own nuances over the period of time and now we have soooo much syntax to remember just to save typing get or set. In Java people don't have issue typing same getter and setter, right?
@edandersen
@edandersen 2 ай бұрын
I think auto properties are pretty good but yeah, there is a lot of stuff to worry about now. Thanks for the comment!
@DamianHallbauer
@DamianHallbauer Ай бұрын
I don't love typing code anymore, sometime my old injured hands just can't. So I'm prompting maybe soon training llms to generate code. dealing with the parenthesis and brackets as the language befcomes more fuctional. With Linq and spans being performant. It's not saving time at all at this point but at some point it will nature so as to be able to maintain code. focusing on a llm code generator prompts, say to use design patterns like collections not having a setter, using lazy load on getter's, to generate code in this style or other or to do these very repetitive chores . I'm hopefing to invest in tooling goal being not having to type , and The intellectual property should just be the English description, in the empedded comments and Attitubutes and tags. And the scripts thant might extract that metadata, and a general plus application core prompt. The best about C# is you can just usually update and build and it's much faster, and keep the old systax or use non AI tools to batch update syntactic sugar and commit it as one pass. the abstract algebra and fixed point math for the snapdragon was added on .net 9. That's can really make a system use much let heat and battery, before it just didtn matter. I can only hope Microsoft commits to this low power chip for portables, it changes the artchiture for alot of problems away from GPU to CPU simd and cache friendly. Intrinsics are abstracted so hopefully it will run on anything but we still have to keep in mind what size buffers to use and such.
@rikudouensof
@rikudouensof 2 ай бұрын
maui MVVM is full of partial class for community toolkit
@edandersen
@edandersen 2 ай бұрын
Fair
@enjoful
@enjoful 2 ай бұрын
Can I work for you? 😂 the true MVP
@ParsaMokhtariHessar
@ParsaMokhtariHessar Ай бұрын
I really would like c# to support union types!
@edandersen
@edandersen Ай бұрын
That would be pretty wild! Thanks for the comment :-)
@Biometrics
@Biometrics Ай бұрын
C# is amazing. Back in the days I resisted it and wanted nothing to do with it. I changed my attitude towards it after it started warming up to the OS platforms that I develop software applications in. I have in recent times developed C# applications for Windows, Web and Android in .NET MAUI. I hope one day I will be able to developed C# applications for Linux too.
@edandersen
@edandersen Ай бұрын
I love C#! thanks for the comment!
@CoolestPossibleName
@CoolestPossibleName 2 ай бұрын
Of course, everything has to be a podcast 🙄
@edandersen
@edandersen 2 ай бұрын
not a podcast cos I say so 😅 thanks for the comment!
@SaveTheHedgehog
@SaveTheHedgehog Ай бұрын
You're just showing new features but not explaining it.. that's why i downvoted
@edandersen
@edandersen Ай бұрын
thanks for watching anyway!
@ianmarteens
@ianmarteens Ай бұрын
Underwhelming update. A whole year for just this. And C# 12 primary constructors are not only underwhelming, but also a failure as design.
@AlFasGD
@AlFasGD Ай бұрын
Underwhelming update because they invested a lot into roles and extensions and they didn't make it into this year's update, so we were left with the rest of the features that were pushed. Some were just put to make up for the uncertainty of pushing extensions in this version, like the backwards indexing and the \e escape sequence. For primary constructors I think the biggest issue is that we still have not figured out what goes into a constructor and what does not. So the team invested and provided the bare minimum that nobody would disagree with, simplifying down the copy-pasted mapping code, in combination with field initializers. For my pov, constructors should be the dumbest possible pieces of code that simply assign values into fields, and initialize other fields to prepare the object for usage. Others prefer their constructors doing domain validation, which I completely disagree with. Once we sort this out and fixate into one use case for constructors, then will the team decide how to expand primary constructors.
@edandersen
@edandersen Ай бұрын
C# 14 should fail to compile and constructor with logic in it. variable assignment only. that would be an improvement
@mAcCoLo666
@mAcCoLo666 Ай бұрын
​@@edandersen They'll never do that, it's just too limiting. Having the ability to specify pre-, post conditions and invariant (a la microsoft contract) would be great though.
@DanielFerreiraMonteiroAlves
@DanielFerreiraMonteiroAlves Ай бұрын
I don't see primary constructors as a design failure; for me, it's merely incomplete. Kotlin is an amazing language and offers a more comprehensive approach (with init blocks, member initialization as parameters, etc.). This is just my humble opinion.
@ianmarteens
@ianmarteens Ай бұрын
@ well, that’s a valid opinion, assuming you have some faith in the team. So let me be more specific: p.c. in the current iteration, are dengerous. I used them a couple of times while writing new code, just to discover I needed more initialization later. Fixing the code took some precious time. At least, records have a very specific use case and they are harder to misuse.
What .NET Conf means for you as a .NET developer
8:12
Ed Andersen
Рет қаралды 17 М.
What's new in .NET 9 and C# 13
19:21
Filip Ekberg
Рет қаралды 21 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
7 C# Tips and Tricks to impress your .NET Developer friends
7:48
What's new in C# 13 & .Net 9
15:13
Spaghetti Code
Рет қаралды 1,4 М.
Await Async Tasks Are Getting Awesome in .NET 9!
9:24
Nick Chapsas
Рет қаралды 103 М.
The New Option and Result Types of C#
15:05
Nick Chapsas
Рет қаралды 83 М.
The Right Way To Return API Errors in .NET
10:40
Nick Chapsas
Рет қаралды 67 М.
C#'s Best features you might not be using
31:20
dotnet
Рет қаралды 28 М.
New .NET 9.0 Blazor Features!
9:17
The Code Wolf
Рет қаралды 16 М.
Why Developers and Companies Hate .NET 9
10:56
Nick Chapsas
Рет қаралды 56 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН