|
|
|
|
|
by mrkeen
276 days ago
|
|
This is syntactic sugar only. No change in semantics. So I don't buy into any argument about what this change 'means'. And we all get to choose what we find ridiculous: i = i + 1 ? No it does not. Never has, never will. Connection is null? It's insane to type it as Connection then. null has type Null. |
|
The syntactic sugar already exits before this change. That is to say, in a version f C# without the feature, you can write this:
It's not not well-formed semantically.What the change does is allow the above to be well-formed semantically. If b isn't null, then it behaves like a.b.c = foo. Otherwise, the value of foo is discarded. (Perhaps foo isn't even evaluated?!)
The idea that there is no change in semantics, but only syntactic sugar is exactly backwards.
A particular meaning was assigned to combinations of syntactic sugar which were previously invalid.
That meaning involved making a design choice among multiple possible meanings.
Is there any public visibility to the design decision; what alternatives were considered for the semantics and rejected?