Re:F# 3.1 as C# 6.0 Strict Mode
by danek on Saturday March 01, 2014 @01:16PM
(#7325369)
Structural typing would be nice. My wish would be algebraic data types. I'm not sure how that would even work in c# but its what I want :)
I tend to avoid using out parameters. I've written extension methods to replace the typical out param framework methods..
For example, instead of int.parse(string s, out int i), we have "123".TryParse<int>(), which returns a nullable int. instead of TryGetValue on dictionary, we have GetOrDefault(key, optional default val) and GetOrDefaultAsNullable(key).
I think the new out parameter syntax is an improvement, but I'm still on the fence about whether out parameters are even a good idea when we can instead return a single type that encodes the same information.
I'd be interested in hearing other viewpoints on this.
I tend to avoid using out parameters. I've written extension methods to replace the typical out param framework methods.. For example, instead of int.parse(string s, out int i), we have "123".TryParse<int>(), which returns a nullable int. instead of TryGetValue on dictionary, we have GetOrDefault(key, optional default val) and GetOrDefaultAsNullable(key).
I think the new out parameter syntax is an improvement, but I'm still on the fence about whether out parameters are even a good idea when we can instead return a single type that encodes the same information.
I'd be interested in hearing other viewpoints on this.