Like everything except "Ref returns and locals". I don't think I've ever seen a case where I wished for that feature. All the other things - tuples, anonymous out vars, pattern matching - I've found myself wanting quite often.
I believe ref returns are a performance feature. They seem a bit like move constructors in C++ in that they can save you a copy? But I am not confident I understand the nuances of move constructors to compare them properly.
What’s New in C# 7.0
21–30 of 278 posts
Re: What’s New in C# 7.0
#22Like everything except "Ref returns and locals". I don't think I've ever seen a case where I wished for that feature. All the other things - tuples, anonymous out vars, pattern matching - I've found myself wanting quite often.
I believe ref returns are a performance feature. They seem a bit like move constructors in C++ in that they can save you a copy? But I am not confident I understand the nuances of move constructors to compare them properly.
Re: What’s New in C# 7.0
#23Re: What’s New in C# 7.0
#24Re: What’s New in C# 7.0
#25Since C# is starting to look more like JavaScript (i.e. local functions) and vice versa (i.e. arrow aka lambda expressions). I'm going to throw my pocket change into a couple features I've been growing old hoping to see: 1. Regex expressions just like Regexp in JS: /^\s+$/.IsMatch(" "); // or Regex r = /^\s+$/; 2. DateTime expressions, similar to regex, something like: DateTime clockTowerLightning = #1955/11/12 10:04…
Re: What’s New in C# 7.0
#26If only .NET had a suitable cross-platform UI toolkit, then I'd be using it everywhere. Eto.Forms is a good attempt but I found rather buggy and limited at this point in development. Avalonia, while further along in terms of stability and features, doesn't even try to fit in with any platform's look and feel.
Re: What’s New in C# 7.0
#27Since C# is starting to look more like JavaScript (i.e. local functions) and vice versa (i.e. arrow aka lambda expressions). I'm going to throw my pocket change into a couple features I've been growing old hoping to see: 1. Regex expressions just like Regexp in JS: /^\s+$/.IsMatch(" "); // or Regex r = /^\s+$/; 2. DateTime expressions, similar to regex, something like: DateTime clockTowerLightning = #1955/11/12 10:04…
Re: What’s New in C# 7.0
#28In the binary literal proposal there is also some unresolved discussion about octal support, chip in if you like: https://github.com/dotnet/roslyn/issues/215
2#1010101
8#75342
1341235
10#13451
16#feb1300
radix#value, from erlang.Or:
#b10101
#xfefe
#o7777
#36rSSSS
From common lisp.Customize in some fashion for C# and its current notations for hex and (now) binary literals.
036rSSSS
02r10101
0b10101 // this and above are equalRe: What’s New in C# 7.0
#29It looks like they've added a lot of rope to hang ourselves with typos. int myvar, I; foo(out int mvar); // oops, not myvar; maybe caused by a refactor? bar(out *); // oops, not I; was up too late coding And so on. Things like this would be easily missed when reading code at-a-glance, and it's this sort of bug that arises often in languages that allow implicit declaration of variants.
> foo(out int mvar); // oops, not myvar; maybe caused by a refactor? This should fail to compile, it's the equivalent of declaring a variable twice int the same scope.
Re: What’s New in C# 7.0
#30Pattern matching! Tuples! Awesome, C# 7.0 is scratching two itches I've felt every time I've worked with it. If only .NET had a suitable cross-platform UI toolkit, then I'd be using it everywhere. Eto.Forms is a good attempt but I found rather buggy and limited at this point in development. Avalonia, while further along in terms of stability and features, doesn't even try to fit in with any platform's look and feel.