3 ms·
I have not even started using C#6, which introduces the Null-Conditional operator. I expect this to already cleanup a lot of that verbose null-checking code, an
by Maarten88 11y ago
I have not even started using C#6, which introduces the Null-Conditional operator. I expect this to already cleanup a lot of that verbose null-checking code, and avoid null reference exceptions simply because checking for null gets so much easier.
To me, as a C# dev, this proposed change seems rather quick (let C#6 get some use first) and it also seems not consistent with nullable value types: with a reference type you'll get a compiler warning where the same error on a value type will give an error.
- jasode 11y ago>To me, as a C# dev, this proposed change seems rather quick (let C#6 get some use first) ... Not really. The non-nullable references feature request has been on the radar for many years. (E.g. this July 2009 stackoverflow post[1]). There are also some very old MS channel9 videos where Anders Hejlsberg acknowledged that the community wants this safety feature and discusses the difficulties of implementing it. I don't have a link to the video but this 2008 stackoverflow post mentions a Computerworld interview on the topic.[2] Non-nullable references is not a shoot-from-the-hip feature addition, and the C# team has been thinking about it for a very long time [1]http://stackoverflow.com/questions/411906/c-sharp-net-design-flaws http://stackoverflow.com/questions/411906/c-sharp-net-design... [2]http://stackoverflow.com/a/178090 http://stackoverflow.com/a/178090
- CmonDev 11y agoTwo year release cycles are quick for you?
- Maarten88 11y agoNo, but Visual Studio 2015 came out July 20, only 7 weeks ago. I've been using it 3 weeks now. I find it difficult to judge a proposed feature when there was so little time to get used to the current situation. Maybe it's a great idea, I don't know. It looks like the next step beyond the Null-Conditional operator. I'll be migrating a lot of code to use that in the coming weeks. After that I'll have a much better idea how much I like this idea.
- ygra 11y agoIt's a proposal. It doesn't even have to be implemented in the language for the next version. The C# 6 proposals were done a long time ago as well, and some didn't make it into the language after all. What would you have the language designers do? Wait two years before even thinking about what to work on next?
- Sanddancer 11y agoIt was released 7 weeks ago, but has been in preview for several months prior to that. This could be a result of looking at feedback for the preview, and deciding that this feature wasn't a good fit for 2015, but was something that should be discussed soon.
- Locke1689 11y agoDon't mistake the dev workflow for what the customer sees. Now that we're open source we've pulled back the curtains, but this is how it's always worked. We plan new language features years in advance.