Replies: 2 comments
-
That is already legal syntax where |
Beta Was this translation helpful? Give feedback.
-
We have seen a number of proposals that each reduces the amount of "noise" in C# code by a few characters. Each taken on their own, adds little. Taken together though, they could add up to a significant effect. However, I don't think this proposal passes the "readablility over writeability" test. The optional nature of |
Beta Was this translation helpful? Give feedback.
-
This thought just struck me. Not entirely sure where to suggest it so I'm doing it here. If this is the wrong place I'm totally sorry, just let me know and I will never do it again ;-)
Anyway. It would be super nice not to have to type "new" every time a throw an exception. Is there a case where you are not creating an object reference for an exception?
Version Used:
C# <= 7
Current Behavior:
throw new InvalidOperationException("Email must be present.");
Suggested Behavior:
throw InvalidOperationException("Email must be present.");
Beta Was this translation helpful? Give feedback.
All reactions