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

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 80

  • @edandersen
    @edandersen  24 дні тому +11

    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 24 дні тому

      just use an audio preset in your video editor to apply some subtractive eq on the lowend and a bit of compression.

    • @edandersen
      @edandersen  24 дні тому +3

      what does that even mean lol

    • @luckyknot
      @luckyknot 24 дні тому

      @@edandersen what software you use for your video editing?

    • @TheRubiosMusic
      @TheRubiosMusic 24 дні тому +1

      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  24 дні тому

      @@luckyknot A mixture of OBS and Davinci Resolve

  • @keyser456
    @keyser456 24 дні тому +10

    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  24 дні тому +1

      Very true! Thanks for the comment!

    • @ubudubu100
      @ubudubu100 15 днів тому +2

      Ok, partial classes are useful, I agree. But what is the usage of partial properties or methods?

    • @keyser456
      @keyser456 15 днів тому

      @@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  15 днів тому

      @@keyser456 more like "someone's performance review is coming up and they need to shoehorn something in"

    • @j3k2006
      @j3k2006 11 днів тому

      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 24 дні тому +6

    allow ref struct is another amazing feature of C# 13 and .NET 9

  • @alexanderrasch6053
    @alexanderrasch6053 24 дні тому +4

    Nice video as always, but when will C# slow down and give use longer LTS versions q_q 5 year plz

  • @SirBenJamin_
    @SirBenJamin_ 24 дні тому +6

    [ ] 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  24 дні тому +1

      Yeah that was a pretty good one. Thanks for the comment!

    • @georgehelyar
      @georgehelyar 24 дні тому

      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_ 23 дні тому

      @@georgehelyar hmm, not had that, but I only really use them for simple types.

    • @robinheyer708
      @robinheyer708 15 днів тому

      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 16 днів тому +1

    Appreciate the share!
    a question: why win10 and not win11 or linux (Rider)?

    • @edandersen
      @edandersen  16 днів тому +2

      Just prefer it as a virtual machine :-) thanks for the comment!

    • @user-lk1hg9ev5u
      @user-lk1hg9ev5u 16 днів тому

      ​@@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  15 днів тому +1

      @@user-lk1hg9ev5u taskbar on the top, no TPM requirement for VMs

  • @matrixview
    @matrixview 24 дні тому +2

    At some time I'd like to learn C# / .NET What books and/or courses would you recommend Ed?
    Thusfar very happy with PowerShell (built on .NET), which is great for creating/wrapping commandline tools... My main focus is automation/web-scraping/AI/RestAPIs.

    • @edandersen
      @edandersen  24 дні тому +1

      Hey, check out my "Brutally Honest Advice" video for some book recommendations. thanks for the comment!

    • @yourcrazybear
      @yourcrazybear 24 дні тому

      The internet is full of documentation and tutorials. You don't need to buy a book for that.

  • @juleseastlondoncockney8131
    @juleseastlondoncockney8131 24 дні тому +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  24 дні тому

      That's fair! the equation is changing though.

  • @RocketC0de
    @RocketC0de 13 днів тому

    Thank you for this video, very informative!

  • @SirBenJamin_
    @SirBenJamin_ 12 днів тому

    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  12 днів тому +1

      4.8.2 is fine. No Blazor or Razor Pages ;-)

  • @keyser456
    @keyser456 24 дні тому +5

    For brevity, why would we not use a collection initializer in C# 12? var subsList = new SubscriberList([ "Barry", "Larry" ]);

    • @edandersen
      @edandersen  24 дні тому +1

      This one is even shorter! No square brackets lol

    • @keyser456
      @keyser456 24 дні тому

      @@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  24 дні тому +4

      @@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 24 дні тому

      ​@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 23 дні тому

      ​@@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.

  • @devpitch
    @devpitch 21 день тому

    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  21 день тому

      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 19 днів тому

      @@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.

  • @abdullahleghari
    @abdullahleghari 24 дні тому +3

    Some day C# will have all features a programming language can have :)

    • @yourcrazybear
      @yourcrazybear 24 дні тому +6

      With hundreds of ways to do the same thing? 🤣

    • @abdullahleghari
      @abdullahleghari 24 дні тому

      ​@@yourcrazybear we're long past that point. Only C++ is serious rival.

    • @emptycode1782
      @emptycode1782 20 днів тому +3

      ​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 13 днів тому

      Yeah, it's sad!

    • @BarrySlisk-g6v
      @BarrySlisk-g6v 13 днів тому

      @@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!

  • @Hannes7046
    @Hannes7046 21 день тому

    Thanks, the best podcast I have watched for some time! 😃

    • @edandersen
      @edandersen  21 день тому +1

      noooo it's not a podcast!!! (thanks for the comment!)

  • @Shagidelic
    @Shagidelic 24 дні тому +3

    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  24 дні тому +1

      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 6 днів тому

      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.

  • @Biometrics
    @Biometrics 20 днів тому +1

    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  20 днів тому +1

      I love C#! thanks for the comment!

  • @enjoful
    @enjoful 24 дні тому

    Can I work for you? 😂 the true MVP

  • @rikudouensof
    @rikudouensof 24 дні тому +1

    maui MVVM is full of partial class for community toolkit

  • @ParsaMokhtariHessar
    @ParsaMokhtariHessar 21 день тому

    I really would like c# to support union types!

    • @edandersen
      @edandersen  21 день тому +1

      That would be pretty wild! Thanks for the comment :-)

  • @ianmarteens
    @ianmarteens 23 дні тому +3

    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 23 дні тому +1

      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  23 дні тому +1

      C# 14 should fail to compile and constructor with logic in it. variable assignment only. that would be an improvement

    • @mAcCoLo666
      @mAcCoLo666 21 день тому

      ​@@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 19 днів тому +2

      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 18 днів тому

      @ 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.

  • @CoolestPossibleName
    @CoolestPossibleName 24 дні тому

    Of course, everything has to be a podcast 🙄

    • @edandersen
      @edandersen  24 дні тому +1

      not a podcast cos I say so 😅 thanks for the comment!

  • @SaveTheHedgehog
    @SaveTheHedgehog 22 дні тому

    You're just showing new features but not explaining it.. that's why i downvoted

    • @edandersen
      @edandersen  22 дні тому +1

      thanks for watching anyway!