What’s new in C# 13 | BRK186

Поделиться
HTML-код
  • Опубликовано: 13 янв 2025

Комментарии • 82

  • @aderitosilvachannel
    @aderitosilvachannel 3 месяца назад +2

    Awesome new features! I will certainly be using all those right away!
    Allocation free `params`? Property declarations without having to worry about the backing field, once and for all? Extension types? Damn, this is huge! Well done, guys!

  • @krss6256
    @krss6256 7 месяцев назад +32

    That example with extension types with Json is so great! Really show how amazing is this feature.

  • @flygonfiasco9751
    @flygonfiasco9751 7 месяцев назад +52

    Giving compiler warnings and hints when the language is added upon is great. Imo, not particularly disruptive and the language as a whole will benefit

    • @computer9764
      @computer9764 7 месяцев назад +5

      I'm surprised the audience didn't give a standing ovation for that one.
      I don't like adding crippled features so they don't break 0.002% of old code that could just not upgrade.

    • @pedrobettt
      @pedrobettt 7 месяцев назад +2

      @@computer9764 They've done this several times before, people always like it

    • @justanaveragebalkan
      @justanaveragebalkan 7 месяцев назад +2

      Do you know what's not great, saying we should var everywhere were it's possible for readability purposes...then few years down the line waking up choosing violence saying you're thinking of changing how var works.

    • @sgbench
      @sgbench 4 месяца назад

      @@justanaveragebalkan What are you talking about?

  • @mertsch
    @mertsch 7 месяцев назад +31

    Incredible features! Yes, PLEASE break things to make the language better! I rather have some (fixable) breaks, than having to re-adjust to legacy code all the time.

  • @Hewtoob
    @Hewtoob 7 месяцев назад +13

    Excited about Extensions 😍😍😍😍😍😍 and what a nifty side effect to use explicit extensions instead of using aliases. 👏👏👏👏

  • @DennisJ42
    @DennisJ42 7 месяцев назад +7

    Wow! Finally got extension types! Exciting stuff!

  • @rustkitty
    @rustkitty 7 месяцев назад +1

    He just casually throws in the possibility of extension operators in a future version near the end! What a tease!

  • @canabale
    @canabale 6 месяцев назад

    You couldn't have picked better features for this next C# version. Very happy with what i am seeing here. Keep up the great work! :)

  • @DocuFlow
    @DocuFlow 7 месяцев назад +5

    Excellent! Thanks guys. Love the excitement you have for the framework. One of us!
    I just wish JSON was a first class type safe dynamic/dictionary type thing that runs off schemas/annotations so all this stuff just happens.

  • @lost-prototype
    @lost-prototype 7 месяцев назад +11

    I should have attended this one while I was there and asked them about union types! ;D

    • @isaacayodejii
      @isaacayodejii 6 месяцев назад

      you want to start an unending argument

  • @austinbryan6759
    @austinbryan6759 7 месяцев назад +1

    Man I've been following extension everything for like 6 years now, since C# 8. Finally its getting added!

  • @aderitosilvachannel
    @aderitosilvachannel 3 месяца назад +2

    Extension types as wrappers are an amazing concept. I will use those a lot in my libraries. For example, adding a position property to a string, to turn it into a cheaper string reader, instead of creating a new StringReader just for position tracking. I'm very curious to know where and how are the extension property values stored. Maybe weak references? Or, are extension properties read-only only?

  • @viccie211
    @viccie211 7 месяцев назад +3

    Those extensions seem very awesome!

  • @zahir2342
    @zahir2342 7 месяцев назад +9

    I wish we will eventually be able to implement an interface "for" a sealed type or a value type, and use that implementation in generic context without additional overhead.

    • @sgbench
      @sgbench 4 месяца назад

      Yes, something like "implicit extension FooString for string : IFoo" would be awesome

  • @mynameisshadywhat
    @mynameisshadywhat 7 месяцев назад +3

    Love this. Extension everything!

  • @Weingeist1987
    @Weingeist1987 7 месяцев назад +3

    I really love the new Extensions

  • @Copium-el8jh
    @Copium-el8jh 7 месяцев назад +5

    Breaking changes are ok!

  • @rabbitwarrenrecovery
    @rabbitwarrenrecovery 7 месяцев назад +2

    I really hope this new Extensions implementation gets into the release.

  • @masonwheeler6536
    @masonwheeler6536 5 месяцев назад +3

    Implicit extension class syntax: we've now come full circle. The concept of "class helpers" was first created in Delphi. C# copied the idea, but not the syntax, and built upon it to make extension methods. And now for "extension everything" they're creating something that looks remarkably like the Delphi class helper syntax! 🤣

  • @mar_sze
    @mar_sze Месяц назад

    Why does the *field* keyword not make auto fields *readonly* by default?

  • @lx2222x
    @lx2222x 7 месяцев назад +7

    C# is *S* tier language

  • @evarlast
    @evarlast 7 месяцев назад

    I just love these two presenters.

  • @Grimlock1979
    @Grimlock1979 6 месяцев назад +1

    The breaking change caused by the field keyword is very minor. The benefit greatly outweighs the inconvenience.

  • @markusTegelane
    @markusTegelane 7 месяцев назад +2

    Microsoft: breaks legacy code
    me: wait, that's illegal

  • @nohardfeedback
    @nohardfeedback 7 месяцев назад +1

    Would BE intresting to see that Windows IS written ENTIRELY in c#

  • @TheChonsey
    @TheChonsey 7 месяцев назад +2

    Is there anything I have to switch to enable extensions? I have latest VS Preview and .NET 9 Preview 4 but for some reason compiler doesn't recognize this feature.

    • @FlameFlash123
      @FlameFlash123 7 месяцев назад +1

      its not available in preview iirc

    • @JaliyaUdagedara
      @JaliyaUdagedara 7 месяцев назад +2

      This feature isn't included in the latest preview (17.11.0 Preview 1.0)

    • @mvonballmo
      @mvonballmo 7 месяцев назад +1

      They mentioned at the beginning of introducing the feature that they were using a version of Roslyn built from an open PR. It's not available yet.

  • @Meligy
    @Meligy 7 месяцев назад +1

    Can I have a file scoped explicit extension to use as a using alias only in this file?

    • @AvenDonn
      @AvenDonn 7 месяцев назад +1

      Sounds like normal private methods with extra sugar.
      But that might be nice and relatively easy to bolt on!

  • @Alguem387
    @Alguem387 7 месяцев назад +1

    If i extend multiple types with the same extension name how does it resolve in the caller?
    Will it work kinda like a rust trait or will it be an error

    • @olovjohansson4835
      @olovjohansson4835 7 месяцев назад +1

      Just thought it reminds me a bit of how Rust traits work

    • @sgbench
      @sgbench 4 месяца назад

      I imagine it will follow the normal type resolution rules - just like if you declare multiple types with the same name

  • @krss6256
    @krss6256 7 месяцев назад

    By the way, is the explicit extension on 'object' an implementation of a 'shape' concept?

  • @chrisnuk
    @chrisnuk 6 месяцев назад

    The killer app for me would be using an extension to add an interface to the class for testing with IoC and avoid writing a wrapper

  • @shadowsir
    @shadowsir 3 месяца назад

    DU's in C# is the ONLY major feature I'm still waiting for 🙃

  • @sakesun
    @sakesun 7 месяцев назад

    Can we have extension for dynamic 🤔

    • @midare16
      @midare16 7 месяцев назад

      Just do an extension for object, dynamic is nothing more than the object type with an added attribute 😊

  • @wudewang9947
    @wudewang9947 7 месяцев назад

    very powerfull feature

  • @SoyGrep
    @SoyGrep 7 месяцев назад +1

    So we have other features that complicate the answer to the question of which approach is IDIOMATIC. I can already see the endless and useless discussions with other seniors about which of the possible solutions to the problem most of them like.
    Let's just call it C#++

  • @burndasbr
    @burndasbr 7 месяцев назад

    Partial properties tho? 😢

  • @zacharylayne7569
    @zacharylayne7569 4 месяца назад

    I'm going to put @ in front of ALL of my variable names. You never exactly know...

  • @sookk
    @sookk 7 месяцев назад +2

    Love that floral shirt

  • @rogeurroger7119
    @rogeurroger7119 6 месяцев назад

    33:10 The feature is great but this is a bad use case. And it's funny to see how they're overhyped by it :D Parsing, typing and browsing json objects is already trivial using simple classes. It's the wrapper thing, kind of "soft inheritance" that is interesting. Unfortunately they failed to provide a compelling example...

  • @__angle
    @__angle 7 месяцев назад

    🥰

  • @bryanedds8922
    @bryanedds8922 7 месяцев назад

    hello saars i am devloper

  • @shaygus
    @shaygus 4 месяца назад

    Is it only me, or the extension syntax looks awfully like traits?

  • @jackwhitestripe7342
    @jackwhitestripe7342 7 месяцев назад +1

    His shirt design is created by co-pilot

  • @OeHomestead
    @OeHomestead 7 месяцев назад +3

    C# > java, any time of day ;-)

  • @guai9632
    @guai9632 7 месяцев назад +1

    stop it! stop oppressing java people by having all the fun stuff!

  • @matswessling6600
    @matswessling6600 7 месяцев назад +1

    boring is good. programming languages SHOULD be boring.

  • @der.Schtefan
    @der.Schtefan 7 месяцев назад

    The "field" does not bring anything, since the #1 reason to access the backing field is to do stuff like Interlocked.Increment or Exchange in a Method that is not the property accessor.

    • @rustkitty
      @rustkitty 7 месяцев назад +2

      I don't know if that's really the #1 reason to use a backing field but it's definitely not the only one. A popular case where this will be very useful is to trigger an event when the property is set in an MVVM context, e.g. INotifyPropertyChanged in WPF.

  • @TheBrotado
    @TheBrotado 7 месяцев назад +4

    As hyped as i am, its absolute barbarism to use light mode in visual studio in 2024.

    • @aimafirm
      @aimafirm 7 месяцев назад +10

      It is not.

    • @Pretagonist
      @Pretagonist 7 месяцев назад +9

      Agree, but I kinda feel it works better with light mode when presenting.

    • @peternimmo74
      @peternimmo74 7 месяцев назад

      Surely the metaphor we are using is paper, and as such it shouldn't be a super bright white, I prefer light mode, and I shouldn't have to lower the brightness of the monitor not to be blinded. I should be able to get nice bright sunshine in videos and vibrant computer games without having to lower it to not be blinded, so the white chosen for the editor should be the brightness of paper, rather than a blinding light.

  • @WadeBased
    @WadeBased 5 месяцев назад

    We will collect your data more secretly and faster

  • @djtomoy
    @djtomoy 7 месяцев назад

    Does anyone actually still use C#?

    • @richarddefortune1329
      @richarddefortune1329 7 месяцев назад

      Do you use c# at work?

    • @UnashamedlyHentai
      @UnashamedlyHentai 7 месяцев назад

      According to the StackOverflow 2023 developer survey, C# is the 8th most popular language with ~27% of all developers having done extensive work in it in the past year. So yes.

    • @markusTegelane
      @markusTegelane 7 месяцев назад

      yes

    • @nordern1
      @nordern1 7 месяцев назад +1

      Still my favourite language I can actually use at work

    • @richarddefortune1329
      @richarddefortune1329 7 месяцев назад +1

      @@markusTegelane I think the job market for C# is good.

  • @WantMore-mc8dx
    @WantMore-mc8dx 7 месяцев назад

    Please remove the linebreak before first {. Much more readable and see more.

  • @justanaveragebalkan
    @justanaveragebalkan 7 месяцев назад +2

    So glad i left for golang, more nonsense in c#, now we have 2 ways of doing the thing that we already used to be able to do anyway. Also for the love of god, don't change var at all, you will break the internet.

  • @jackwhitestripe7342
    @jackwhitestripe7342 7 месяцев назад

    There will be no code in the future.
    You will describe your problem with natural language and AI will create a computer code (mixed with assembly language)

    • @ghevisartor6005
      @ghevisartor6005 7 месяцев назад +4

      > i have this problem, AI is stealing my job, can you solve that for me?
      > sure! i will write a simple code to delete every AI ever in the world

    • @cheekychappy1234
      @cheekychappy1234 7 месяцев назад

      Isn't that code though? The language is no longer C# but English. You are still defining your problem, its operations etc but using English.

    • @LettersAndNumbers300
      @LettersAndNumbers300 7 месяцев назад +3

      Natural language is too ambiguous.

    • @jackwhitestripe7342
      @jackwhitestripe7342 7 месяцев назад +1

      @@LettersAndNumbers300 The IT language of the world is Sanskrit

    • @_zproxy
      @_zproxy 7 месяцев назад

      @@jackwhitestripe7342 got examples?