you are viewing a single comment's thread
view the rest of the comments
[–] 5 points 2 weeks ago (3 children)
  • Union types

I know this is something folks have been clamoring for for a long time. It looks to me, though, like you're still dealing with object casts, under the hood, so not sure how useful this will be.

  • Closed hierarchies

Neat. Niche, but neat. I could see myself using this.

  • Labeled break and continue

Boy, this one feels like it should have existed a decade ago. I will ABSOLUTELY be using this.

  • Extension indexers

I.E. we can now polyfill Range support. Cool.

  • Collection expression arguments

I am absolutely mindboggled by anyone who thinks this syntax is a good idea. Seriously, it's EXACTLY as verbose as the thing it's trying to replace. What problem does this solve?

  • Memory safety

Sounds neat, I guess. Doubt I'll ever use it.

  • source
  • hideshow 3 child comments
  • [–] 3 points 2 weeks ago (1 child)

    Seriously, it's EXACTLY as verbose as the thing it's trying to replace. What problem does this solve?

    How is it as verbose? It can replace multiple lines of Adds with a single bracketed expression

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 weeks ago

    You mean like the "single bracketed expression" syntax we've had since... hell, I don't even know, C#4?

    List<string> items =
    [
        new(capacity: 10),
        "First",
        "Second",
        "Third"
    ];
    
    var items = new List<string>(capacity: 10)
    {
        "First",
        "Second",
        "Third"
    };
    
  • source
  • parent