Coffeehouse Post

Single Post Permalink

View Thread: Mads Torgersen @ NDC London : The Future of C#
  • User profile image

    This looks fantastic.

    Some initial feedback:

    - I really like the syntax for making a default constructor:

    class Foo(String bar) { }

    but I think it could be even more concise if it allowed you to automatically create properties as in TypeScript:

    class Foo(public String Bar, private String goo) { }

    Here the access modifiers indicate I want properties and not just fields (although a private auto-gen property is probably just unnecessary overhead, so this might be optimized to just being a field anyway).

    - I'm not crazy about the multiple return values. I don't see that as addressing any particular need that exists currently.

    - I'm literally dying to have the null-dereferencing operator already. It would make so much code cleaner. For those of you that say all your types should be non-nullable and it encourages bad practice- trying working with a poorly written 3rd party platform or library and then tell me it's not necessary.

    - I like the expression syntax for properties and methods, although I'd say they should only do this if it's really easy to implement, as it's not a huge value-add.

    - The IEnumerable params is nice and something they've talked about for a long time. Looking forward to it.

    - Static imports are long-overdue. Java has had these literally forever. It's somewhat ironic that the C# team is making importing namespaces even easier, while at the same time on the other side of the coin the TypeScript team is absolutely opposed to any kind of namespace import at all.

    - Constructor type inference looks really helpful. This has really been a clear hole in the language as evidenced by the "workaround" of making static factory methods instead of constructors so that you could use type inference.