Live data from Hacker News

What’s New in C# 7.0

blogs.msdn.microsoft.com

191–200 of 278 posts

Re: What’s New in C# 7.0

#192

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 those aren't local names, the defaults are 'item1', 'item2', etc. They only get that name if you explicitly declare it in the function declaration.

Re: What’s New in C# 7.0

#196
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…

out/ref still have their uses when interfacing with COM or P/invoke.

Re: What’s New in C# 7.0

#197

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.

Why not winforms? Very convenient, and mostly works in mono

"mostly works" is rather… optimistic.

Re: What’s New in C# 7.0

#198
post #71

Sometimes it feels like we're entering a new age of coding. C# is so full of "features" that code refactoring tools like ReSharper, CodeRush and JustCode became simply indispensable. It is quite hard to be sure, every time, what is the most elegant/compact way of doing things. In the .Net/VisualStudio world, the language tooling (Intelisense, visual drawing XAML & WinForms, etc) became as important as the language se…

That type of programming never went away. That is what I was doing on Windows 3.x and have done while coding in Mac OS X and Windows. Also the reason I never quite adapted to UNIX mentally of VI/Emacs. Even though I have spent enough years coding for UNIX that me and Emacs are quite old acquainted with each other.

There's a Vi plugin for almost everything. Highly recommend VsVim for visual studio.

Re: What’s New in C# 7.0

#199
post #136

Earlier quoted context omitted.

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.

Of course it does, as I said I was doing that.

Borland C++ for Windows 3.x had an initial implementation for templates as they started to be discussed at ANSI and also supported exporting classes across dlls, providing both producer and consumer were Borland C++.

Re: What’s New in C# 7.0

#200

Earlier quoted context omitted.

> CSharp once again showing it is the best language in terms of features and improvements. That's a pretty sweeping generalization. Most of the headline features in the article are already in other languages e.g. Scala.

The difference being CSharp is actually used by a large number of people. Scala is not even in the top 10 used languages [0]. [0] http://www.tiobe.com/tiobe-index/

Your comment was about C# being "the best language in terms of features and improvements", nothing about usage numbers.

I agree that C# is far more widely used than Scala, but Scala is being used by significant numbers of developers esp. for Spark. Tiobe is also widely regarded as a pretty poor indicator of language adoption.

Post reply on HN