3 ms·
Of all the new features, ref return leaves me scratching my head. I agree ref and out should go away. Adding more support for ref will only increase its usage
by snarfy 10y ago
Of all the new features, ref return leaves me scratching my head. I agree ref and out should go away. Adding more support for ref will only increase its usage when it should be deprecated.
- naasking 10y agoWhy not support more safe ref/out uses? I don't see any need for them to go away. You're already disincentivized from using them due to the syntactic annotations required and they aren't compatible with standard delegate parameter types. So if you are using ref/out, you actually need them for some reason (likely performance-related).
- int_19h 10y agoIt shouldn't be deprecated any more so than "unsafe" and "stackalloc". It's a great advanced tool for perf-sensitive code - not something you should reach by default, but something to keep in mind when firing up that profiler. CLR supported the concept since 1.0. Surfacing it in C# has been long overdue, and makes it possible to write more low-level stuff without having to go to C++.