As a heavy TypeScript user myself, it was easy to see the parallels between the designs: question mark nullability, the compiler-enforced nullability checks rather than runtime-enforced, "dammit operator" to override the compiler. All shared between TypeScript and C#.
I love this feature in TypeScript; it's help me find numerous bugs and helps me reason about my code. I'm looking forward to using it in C#.
Anders and I meet every week to compare notes, and I make sure to get his input on major new features in C#.
At least given his latest interviews on Channel 9 and BUILD sessions.
Version 1.0 of C# was the same as Java: Nullable reference types and non-nullable value types. Nullable value types didn't come until version 2.0 but at that point ir was too late to make reference typed non-nullable.
I'm glad they're actually putting the effort to fix this issue now. It's a huge task given the amount of legacy code out there.
However, that's a new way to check for null in the language, where what we need is to recognize the ways people are already checking for null in billions of lines of code. Therefore, the priority is to do a good flow analysis that will just understand when a nullable variable can be assumed to not be null (e.g. after a check, a non-null assignment, etc.), and then let you dereference without challenge.
Another Swift feature that I think leads to very poor readability is trailing closures.
So basically multiple inheritance?
* Nullable Reference Types This makes it so much easier to reason about references. I always found it strange that C# had nullability on value types, but not on reference types.
* Default Interface Implementations Inherit an interface, and get an implementation "for free". This makes for a very powerful way to define interfaces and default implementations.
* Extension Everything As noted in the video/text, the current syntax feels a bit weird -- having to use a static class.
[1]: Not saying these are exclusive to Swift, or Swift was the first to implement them.