S103 - What's Coming to C#?

Sdílet
Vložit
  • čas přidán 31. 07. 2024
  • Over the last year we shipped point releases of C#, full of small but useful language features. Mads will recap some some of these, before turning to the big things we have in store for the future: Nullable reference types, recursive patterns, asynchronous streams and more.
  • Věda a technologie

Komentáře • 72

  • @edisonyeung3657
    @edisonyeung3657 Před 5 lety +3

    Great session. Good to see C# preventing more run errors.

  • @bpdev8017
    @bpdev8017 Před 5 lety +55

    C# should be above Java in the list of most popular languages.

    • @MiningForPies
      @MiningForPies Před 5 lety

      bp dev now oracle are going to start charging businesses for using java sde it will die.

  • @AdamsTaiwan
    @AdamsTaiwan Před 5 lety +11

    Would like to see shorter videos of just the latest features. MS could also create a playlist to link each of the feature version together. I'm suggesting this for each tech. MS has.

    • @robertcasey9550
      @robertcasey9550 Před 5 lety +1

      Seriously. A full hour? A 5 minute highlight to sum up what's new would be great for the working stiff.

  • @Hakunamatata0803
    @Hakunamatata0803 Před 5 lety

    Thanks for improving C# to be more free styling. I was using C# from framework 2.0, that was kind of 2 different languages. Good job😬 ------- from a Chinese C# fan

  • @johnavila7651
    @johnavila7651 Před 5 lety +45

    I love c#

    • @user-mv9bn6vl9v
      @user-mv9bn6vl9v Před 5 lety

      john avila 在中国用c#的都快饿死了

    • @johnavila7651
      @johnavila7651 Před 5 lety

      hi !! friend jin chen

    • @johnavila7651
      @johnavila7651 Před 5 lety

      @@user-mv9bn6vl9v come to latam here there are many companies with this technology, I have friends from china and from korea here they work

    • @user-mv9bn6vl9v
      @user-mv9bn6vl9v Před 5 lety

      @@johnavila7651 There are fewer companies using C# in China. Chinese Internet companies mainly use java.

  • @sudhar1829
    @sudhar1829 Před 5 lety

    span.slice(1,2); is working in code before the array value assignment. but span.Reverse(); is working only after the array value assignment

  • @LamMods
    @LamMods Před 5 lety +9

    Where can I get the "save the day with c#" tshirt?

  • @md.mozibur.rahman
    @md.mozibur.rahman Před 5 lety

    that 'in' keyword melt my heart

  • @stebberg
    @stebberg Před 5 lety

    Nice!

  • @khrv1695
    @khrv1695 Před 5 lety +1

    In span ranges can I use variables?

  • @andrewzuo86
    @andrewzuo86 Před 5 lety

    Yes, multiple inheritance is here! Fsck yeah!

  • @sushantchoudhary6393
    @sushantchoudhary6393 Před 5 lety +9

    With the introduction of default interface members to interfaces, what really is the difference anymore between interfaces and abstract classes?

    • @metaltyphoon
      @metaltyphoon Před 5 lety +7

      You can inherit from multiple interfaces

    • @xtm8194
      @xtm8194 Před 5 lety +8

      Interface exposes the functionalities for the implementing class. Abstract classes are a partial implementation that must be extended upon.
      Interfaces do not store data. Abstract classes can store data.
      Abstract classes can implement an Interface.
      Use abstract class to implement an interface when there will be multiple implementations sharing similar properties. e.g security configuration with username and password.

  • @scwyldspirit
    @scwyldspirit Před 5 lety

    I looked last week and while C# has been on a upward path, Java has taken a nosedive ever since Oracle made the decision to start charging for the SE starting with version 11.

  • @sudhar1829
    @sudhar1829 Před 5 lety

    I am getting exception in the following code
    var c = ref a.calculate(b);
    Error CS8171 Cannot initialize a by-value variable with a reference
    Please clarify my doubt

  • @Grimlock1979
    @Grimlock1979 Před 5 lety +6

    Where can I get a shirt like that?

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

    what about vb?

  • @Kratax
    @Kratax Před 5 lety

    If passing as non mutable ref is more efficient, then why not just do it always automatically without a new separate keyword to worry about?

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

    Funny thing they still try to implement features from F# in C#. Things like pattern matching is way more intuitive in F# and I guess the default interfaces try to emulate the type system. Why not simply promote F# for functional styles and C# for object oriented? It makes way more sense (OOP kind of sucks in F# by the way)

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

    I wonder how Javascript would fare if it were not essentially the browser language. :-) I wouldn't go near it.

    • @TheMonk72
      @TheMonk72 Před 5 lety

      I imagine that all of the Node.js folks would keep the numbers up. JS isn't just for browsers.

  • @r1pfake521
    @r1pfake521 Před 5 lety +3

    Will C# ever add a generic constraint for "numbers" which allows us to write generic methods which take int, long, float etc and use operators like + or - etc on the generic types, please?
    For example a generic method with Sum(List numbers) where T : SomeNumberKeyword which allows use to pass a list of int or long etc and sum the values inside the generic method?
    This is currently not possible because operators like + are not allowed inside generic methods, the only "workaround" is to copy/paste the method for every number type

    • @IAmFeO2x
      @IAmFeO2x Před 5 lety

      There is a new feature called Shapes coming, probably for C# 8.0. A shape is basically an interface, i.e. it defines callable members, not there implementation, but with two important differences: 1) you can declare static members on it. 2) You can only use for generic constraints, you cannot implement it in classes (but you can inherit from other shapes when writing a shape). This would allow you to define a shape SNumber that defines the numeric operations like Addition, Substraction, Multiplication, Division, etc. and you can apply to a generic of a method like this: public static T Add(T x, T y) where T : SNumber => x + y;
      Check out this GitHub issue for more infos: github.com/dotnet/csharplang/issues/164

    • @r1pfake521
      @r1pfake521 Před 5 lety

      Never seen these "shapes" before, thanks for the link!

  • @HarshColby
    @HarshColby Před 5 lety +10

    to further simplify the syntax, Instead of ref int c, next we'll see int *c...history repeats itself. Just guessing :)

    • @lucasteles42
      @lucasteles42 Před 5 lety +3

      'int *c' is a valid declaration now, like c, c# has pointer in a way we need to explicitly say the code is unsafe, 'ref int' is a more safe way to deal with pointers like references

    • @PaulPaulPaulson
      @PaulPaulPaulson Před 5 lety

      If history repeats itself, we should be able to use Smalltalk syntax in C# in some years. Would actually like that 😁

  •  Před 5 lety +5

    ref all the things

  • @pavelernestonavarroguerrer7871

    you can use a * instead of ref. :)

  • @jeffpotts6187
    @jeffpotts6187 Před 5 lety

    I use "ref" all of the time. It's almost a requirement when you do system-level work, and stuff where allocating data all of the time is prohibitive. Although I have no idea how adding an extension method make my life any easier...

    • @qobalt
      @qobalt Před 5 lety

      Jesse Davis well, strings are immutable by default and are reference types. So basically 0 profit, still getting a copy. But ext-methods are more readable if named fluent way :)

  • @miroslavmakhruk4102
    @miroslavmakhruk4102 Před 5 lety +1

    Using caret in indexing to define X from the end is a terrible idea 'cause in RegExp it means "from the beginning". So if you work a lot with strings it will confuse you...

  • @UndeadAntZombie
    @UndeadAntZombie Před 5 lety

    Does anyone know what Windows laptop that is that the fella is using?

    • @hichaam2
      @hichaam2 Před 5 lety +1

      I think it's a Surface book 2

  • @estergym5083
    @estergym5083 Před 5 lety

    Rust S2
    Edit: c# u2

  • @Narutomanic
    @Narutomanic Před 5 lety

    Also.... is C# just now having support for passing by reference? What a great language it is......

    • @pilotboba
      @pilotboba Před 5 lety

      You could always pass by reference. Is that what you got out of this video?

  • @warrenbuckley3267
    @warrenbuckley3267 Před 5 lety

    So, now that we can return a reference, does this mean we always have to be careful of returning a dangling reference?

    • @walkerjian
      @walkerjian Před 5 lety

      no, just wrangling a deference... I could do more with VB6! and quicker! and then there was TurboPascal and Modula2 - a complete windowing OS in under 64 KILOBYTES. Just a bit more deckchair shuffling. I may try to use these features for a while, until the rug be jerked out from under my feet in the name of progress, yet again...

  • @ovidiurudi
    @ovidiurudi Před 5 lety

    Is this still an interface? czcams.com/video/M0hdrybOKJg/video.htmlm35s
    Because from my point of view this feature broke the definition of interface.
    This looks like an abstract class...

  • @pushqrdx
    @pushqrdx Před 5 lety

    the switch pattern is a big nope for me

  • @jjxtra
    @jjxtra Před 5 lety

    in keyword for struct should be the default and be optional - struct should only ever be passed by ref (mutate) or by in (readonly). No other mechanism makes sense.

  •  Před 5 lety +3

    I am using c++ because I can make much faster application and I can make embedded application. If C# can evolve to do this I will use alot.

    • @max-diaz
      @max-diaz Před 5 lety +6

      C# wasn't designed for that 😑

    •  Před 5 lety

      I know so I don't use so much.

  • @carlinhos10002
    @carlinhos10002 Před 5 lety +1

    Please, don't do default interface. It will make thing more complex than it will help.

  • @chidieberejoshua5314
    @chidieberejoshua5314 Před 5 lety

    What's Coming to VB.Net?

  • @MrFrimko
    @MrFrimko Před 5 lety +3

    "more freedom" is it really good? Everyone will do what they want, it will be unreadable hard to maintain code

  • @Narutomanic
    @Narutomanic Před 5 lety

    Wtf.. where vb.net, yo?

  • @mzahan
    @mzahan Před 5 lety

    Too long, didn't listen. Could please post an article so I can read it?

  • @ibrahimragab2299
    @ibrahimragab2299 Před 5 lety

    Adding more syntax sugar is not a feature, a feature is something like async/ await, LINQ, Extension methods or generics, by adding more syntax structures will make the language hard to learn and confused for the beginners,the written code will be more complex to read and understood. I'm not the one who can judge what language should be like but this is my opinion.

  • @TechyTubeDotCom
    @TechyTubeDotCom Před 5 lety +1

    Stop moving the camera

  • @Mortizul
    @Mortizul Před 5 lety

    Instead of faffing around with all this nullable reference types, you should just introduce Options.

  • @Mortizul
    @Mortizul Před 5 lety +1

    Don't know why you're redoing Observables, which are a perfectly good way of dealing with asynchronous streams of data. Seems like a waste of time.

  • @MiladPP
    @MiladPP Před 5 lety +1

    Make it like kotlin

  • @valikhanakhmedov5344
    @valikhanakhmedov5344 Před 5 lety

    Nothing innovative unfortunately, but good work anyway :)

    • @qobalt
      @qobalt Před 5 lety

      IAsyncEnumerable should shorten producer-consumer patterns A LOT and do that in asynchronous manner, this is kinda innovative I think

  • @thevoiceyouneverlisten2083

    Microsoft version of JAVA. 😜😜😜

    • @qobalt
      @qobalt Před 5 lety +7

      Well C# has actually more features that are still coming to Java, than vice versa. :)