Live data from Hacker News

What’s New in C# 7.0

blogs.msdn.microsoft.com

151–160 of 278 posts

Re: What’s New in C# 7.0

#151

I just realized that I don't remember I ever saw a C# rant on HN and very very rarely in general. It must have the highest usage/complaints ratio in the industry. Now that I said that I'd love to see the languages ordered by that ratio!

Maybe not exactly what you want but it is a "% of developers who are developing with the language or tech and have expressed interest in continuing to develop with it".

http://stackoverflow.com/research/developer-survey-2016#tech...

Re: What’s New in C# 7.0

#152
post #97
post #42

Earlier quoted context omitted.

The most productive I've been as a developer was 20 years ago when I was creating VB6 apps and components...

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 webforms app with dodgy "we-didnt-know-so-we-rolled-our-own" state management has been a lifesaver. Thank you nineties VB team, it's because of you that I'm not rocking back-and-forth in a padded cell making animal noises today.

Re: What’s New in C# 7.0

#153
post #136
post #85

Earlier quoted context omitted.

Some things can be rather tricky to AOT-compile, especially when you don't have a fixed "world" (i.e. when code can be dynamically loaded, as is the case with both Java classes and CLR assemblies). Consider virtual generic methods, for example. If your set of types is not statically bound, you can't allocate the appropriate number of vtable slots in advance, because you don't know all the instantiations.

C++ has the same problem. I was already using dlls with plugins in Windows 3.1 and C++.

C++ doesn't have this problem, because it doesn't allow virtual function templates.

For that matter, it doesn't allow any templates across ABI boundary, except when you manually instantiate them (extern template) - and then only for those explicit instantiations. So it is effectively impossible to have a generic C++ API using templates that is not statically linked.

Re: What’s New in C# 7.0

#154
post #149
post #146

Earlier quoted context omitted.

They've been around for a long time. I don't think they will become as popular as red gate. Since you have to write the migrations yourself. That's a lot of additional work.

They run deterministicaly though, making them much safer. I've done migrations with these tools that would be impossible with redgate, clients could be several months out of date since an upgrade and the migrations would just work. I've seen redgate/ssdt need manual coaching after just a few weeks. I also think your over estimating the popularity of red gate. A minority of places use it, whereas a lot use EF migratio…

Literally every place I've worked uses red gate.

I've never had an issue with it, If you make sure your database is constantly up to date. So changes are small.

Re: What’s New in C# 7.0

#155
post #2

Out 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…

Hey there, C# language designer here. > Out variables seem like a mis-feature, especially when they are adding a better alternative (Tuples) in the same release. Out variables are really great when working with existing code that predates Tuples (for example, the entire BCL). We don't just introduce language features that will only work well for new code. We also want to make the experience of coding against existing…

Honestly, I'd like to have seen ref returns implemented as attributed out params (syntactic sugar). As it stands I can't see me using them in any of places that I originally planned to - I am exactly the target market for that feature. Still, I'm sure something interesting can be done with this.

Re: What’s New in C# 7.0

#156
post #108

Earlier 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.

Tuple.Create(3, "hello", true)

Type inference FTW.

Re: What’s New in C# 7.0

#157

My instant concern: the variable names used by function declarations have become part of the API. If you use var to match the library producer's naming for tuple members, a rename of the variable in the definition will break your code, as the name you previously used will no longer exist! Old example: bool Hello(string name) {...} var myName = "world"; Hello(myName); The developer can change the name of variables in…

I think named tuple parameters only matters when not deconstructed, when deconstructed the position matter and you can choose your name. If you don't want to take that risk don't name your output parameters.

But that's the same as named parameter, and you didn't complained, if the client used named parameters and you change them it will break their code. The full signature of the method is the public API, as you can see when navigating a compiled assembly.

Re: What’s New in C# 7.0

#158
post #121

Having done a lot of python recently, this looks great (and familiar). But some things feel a little bit rushed: - In the example "(o is int i || (o is string s && int.TryParse(s, out i))": When reading this statement as a human, o is obviously not an int when it comes down to the TryParse function. But if the 1st part was removed, the 2nd part wouldn't be valid either. I know this is technically how declarations wor…

> The Deconstruct method is introduced as a "magic name".

Collection initializers already rely on “magic names” (the `Add` method + `IEnumerable`), so I’d say that’s okay. It’s simply a compiler feature, after all.

Re: What’s New in C# 7.0

#159

Pattern 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.

Very glad to see tuples and pattern matching also. But allowing the tuples to be structs with mutable public fields seems off . Once a tuple is constructed it shouldn't be mutable IMO, unless I'm missing some important use cases?

Quick'n'dirty construction of custom mutable trees, I guess? Don't know about important. Best guess I have.

Re: What’s New in C# 7.0

#160
post #127
post #42

Earlier quoted context omitted.

The most productive I've been as a developer was 20 years ago when I was creating VB6 apps and components...

Did you ever maintain vb6 apps? Because I still want to cry thinking about the times I've had to.

I have. If they were designed well then they are normally OK to maintain. If they were developed badly then they can take extra effort. Much like any other project in any other language.

If you had an large old Vb6 project build using MVP pattern you would be laughing.

Post reply on HN