I don't like the idea of accessing tuple values by their local name var names = LookupName(id); WriteLine($"found {names.first} {names.last}."); It's leaky and should simply use the deconstructing syntax instead. I'm on the fence about the ref returns. It can lead to some fantastic performance improvements and enable otherwise unusable datastructures. But is C# really a language you want if that is important to you.…
> But is C# really a language you want if that is important to you. C# is used by hundreds if not thousands of games by ways of Unity and is therefore demonstrably good enough in this scenario. Furthermore, just because a language is not C++ does not mean you shouldn't take every opportunity to give programmers tools to write fast code - at the end of the day I doubt anyone would be interested in a language that is p…
What’s New in C# 7.0
161–170 of 278 posts
Re: What’s New in C# 7.0
#162Earlier quoted context omitted.
Feels kinda crazy to see tuples and pattern matching "just arrive" when other languages have had them for years.
Sure. Like how streams "just arrived" in Java yet C# has had the equivalent for years. No language has every feature. C# is making enormous strides ahead of many of its counterparts.
Re: What’s New in C# 7.0
#163Earlier quoted context omitted.
So true. Between 1998 and 2000 VB6 was perfect, you could develop Windows GUI applications in a rapid manner. The VB6 IDE, the Windows UI guideline, the VB6 API, everything was great. And PlanetSourceCode.com was what was later SourceForge and nowadays GitHub. When I read about Microsoft's vision for .Net in 1999 about applications running as a service over the internet (that was their original idea), I thought that…
Edit-and-Continue is the greatest productivity feature ever added to a development stack for the real conditions one would encounter in large projects , and it astonishes me even now how misunderstood it's purpose is. Consulting has me moving jobs a lot and I encounter a veritable kaleidoscope of crappy work. Being able to correct minor issues in scope without restarting, while ten form posts deep in an archaic webfo…
Re: What’s New in C# 7.0
#164Earlier quoted context omitted.
Well maybe you don't care, but there are folks that do (I'm on that list) ;-) I want the speed of C but the safety of C#. There are many pieces of code that you probably use every day that go to great lengths to squeeze as much power as possible. Why not help these folks help us? I'm glad there is more focus on performance because we all benefit. (Hoping to see more on the CLR side.)
> I want the speed of C but the safety of C# Try OCaml.
Use a tractor.
Re: What’s New in C# 7.0
#165Earlier quoted context omitted.
There's a few downsides to the Tuple class as mentioned here: https://github.com/dotnet/roslyn/issues/347 Namely, heap allocation and the inability to name tuple members.
And a very verbose syntax. You have to repeat everywhere the different types of the different members.
using Complex = System.Tuple;
Edit: Clarity
Re: What’s New in C# 7.0
#166Out 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…
> it's age compared to something like scala which has return type declarations at the end, which I find much more readable. Scala or .... VB.net!
-Anthony D. Green, Program Manager, Visual Basic
Re: What’s New in C# 7.0
#167Earlier quoted context omitted.
And a very verbose syntax. You have to repeat everywhere the different types of the different members.
I find that the verbosity can be minimised by type aliasing. E.g: using Complex = System.Tuple ; Edit: Clarity
Re: What’s New in C# 7.0
#168In my ideal world, it'd look like...
switch (x)
{
case 1:
{
/* ... */
}
case 2:
case 3:
{
/* ... */
}
}
And before anyone points it out, switch is the same as else if when the thing being compared is a simple local variable.Re: What’s New in C# 7.0
#169 GetCoordinates(out var x, out var y)
over destructuring assignment like var x, var y = GetCoordinates();
the former looks completely backwards.Re: What’s New in C# 7.0
#170I don't like the idea of accessing tuple values by their local name var names = LookupName(id); WriteLine($"found {names.first} {names.last}."); It's leaky and should simply use the deconstructing syntax instead. I'm on the fence about the ref returns. It can lead to some fantastic performance improvements and enable otherwise unusable datastructures. But is C# really a language you want if that is important to you.…
> But is C# really a language you want if that is important to you. C# is used by hundreds if not thousands of games by ways of Unity and is therefore demonstrably good enough in this scenario. Furthermore, just because a language is not C++ does not mean you shouldn't take every opportunity to give programmers tools to write fast code - at the end of the day I doubt anyone would be interested in a language that is p…