What’s New in C# 7.0
blogs.msdn.microsoft.com
What’s New in C# 7.0
1–10 of 278 posts
Re: What’s New in C# 7.0
#2It's great to finally have tuples, but the c/java style syntax is showing it's age compared to something like scala which has return type declarations at the end, which I find much more readable.
Literal improvements will be a godsend for writing database migrations.
Ref returns and locals look like a source of constant headaches. It's much harder to reason with code when the data can be modified by random others bits of code. Currently I can look for all references to an array to find everywhere that modifies it now I can't.
Re: What’s New in C# 7.0
#3Re: What’s New in C# 7.0
#4Out variables seem like a mis-feature, especially when they are adding a better alternative (Tuples) in the same release. It's great to finally have tuples, but the c/java style syntax is showing it's age compared to something like scala which has return type declarations at the end, which I find much more readable. Literal improvements will be a godsend for writing database migrations. Ref returns and locals look li…
You can't retro-fit multiple-returns (via Tuples) onto existing library functions, so for places where you're forced into using out parameters, this is a slight improvement.
Re: What’s New in C# 7.0
#5Out variables seem like a mis-feature, especially when they are adding a better alternative (Tuples) in the same release. It's great to finally have tuples, but the c/java style syntax is showing it's age compared to something like scala which has return type declarations at the end, which I find much more readable. Literal improvements will be a godsend for writing database migrations. Ref returns and locals look li…
Re: What’s New in C# 7.0
#6Out variables seem like a mis-feature, especially when they are adding a better alternative (Tuples) in the same release. It's great to finally have tuples, but the c/java style syntax is showing it's age compared to something like scala which has return type declarations at the end, which I find much more readable. Literal improvements will be a godsend for writing database migrations. Ref returns and locals look li…
Re: What’s New in C# 7.0
#7 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.Re: What’s New in C# 7.0
#8Out variables seem like a mis-feature, especially when they are adding a better alternative (Tuples) in the same release. It's great to finally have tuples, but the c/java style syntax is showing it's age compared to something like scala which has return type declarations at the end, which I find much more readable. Literal improvements will be a godsend for writing database migrations. Ref returns and locals look li…
Scala or .... VB.net!
Re: What’s New in C# 7.0
#9It 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.
You'll get a compiler error if you try and use `I` uninitialized.
Not saying you're wrong, just having trouble getting worried about this. You can make typos now:
int x, y;
foo(out x, out x); // oops, not y; was up too late codingRe: What’s New in C# 7.0
#10I 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.