Live data from Hacker News

What’s New in C# 7.0

blogs.msdn.microsoft.com

241–250 of 278 posts

Re: What’s New in C# 7.0

#241
post #230
post #215

Earlier quoted context omitted.

> People would like to run their Win32 apps on their smartphone And they did actually. Windows Mobile - the original Windows Mobile, 2000-2012 - had 42% smartphone market share in 2007, a native Win32 API (and .Net Compact Framework for C# and VB.Net too), had WinCE kernel and worked on x86, MIPS, ARM and SuperH CPUs.

I loved WinCE/WinMobile back then, except for RAM as document storage - only WinMobile 2005 or so and later supported Flash-storage as well. Though, it supported yet another Win32API implementation with less functions and you had to recompile your code for the target (another reason was: mobile had ARM based CPUs). All what people like me want is NT kernel, Win classic UI, WinAPI with transparent JIT of x86 exe appli…

Add to it resistive screen with stylus - because it provides much more information density instead of gigantic interface elements catered to fingers-driven UI, with no luck however - fingers are closing half of the screen, unlike a thin stylus - hardware qwerty keyboard and a small optical trackpad, which moves a cursor on the screen or works like two-dimensional Tab button cycling focus between UI elements, depending on mode. Removable battery, and multi-color programmable RGB LED would be nice to have too.

I loved it until the 'trendy' movement toward fingers-driven UI started, around version 6.0.

Re: What’s New in C# 7.0

#242
post #51

Earlier quoted context omitted.

Hi there! C# language designer here. You can see (and participate in) the discussion on records here if you'd like: https://github.com/dotnet/roslyn/issues/10154 > Seems like it'd be a cinch to implement Ah... how i wish that were so :)

Indeed. While records are my favorite feature from F#, they could be improved. I'd love it if record definitions were extensible (even abstractly--sometimes you want a record with just the data, and sometimes including db-centric "id, createdTime, etc"), and there should be a way of defining / converting between them without a ton of boilerplate. That would allow something like: record DbStuff = { id: int; created: D…

I second this! The ability to easily create intersection types would be awesome!

Re: What’s New in C# 7.0

#243
post #208

Earlier quoted context omitted.

> It doesn't support Windows modern That's a good thing. > or Mac OS X "Does Winforms run on OSX? Yes, as of Mono 1.9, Winforms has a native OSX driver that it uses by default" http://www.mono-project.com/docs/faq/winforms/ > it looks completely out of place on Linux On KDE3? KDE4? KDE Plasma? Gnome2? Gnome3? MATE? Cinnamon? LXDE? LXQt? Xfce? CDE? GnuStep? Unity? Enlightenment? Non-DE X Window System environment - wi…

Going by the documentation you linked yourself: > In terms of integrating visually with the desktop, we currently ship with a classic Win32 theme. That sticks out like a sore thumb everywhere , including every Win32 release since Windows 2000.

The standard Win32 theme is the classic, an engineering marvel. Everything else that came after that - starting with the infamous native Windows XP theme - was and is a horrible mess.

Re: What’s New in C# 7.0

#244
post #60

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.

This is the feature I've been waiting for! Correct me if I'm too excited, but won't these be an excellent alternative to maintaining lots of DTOs for SQL calls?

I was thinking the same, I never really liked having those, also good for handling responses from services.

Re: What’s New in C# 7.0

#245
post #126

Will C# ever start to increase type inference to make it less verbose? Local functions are ok. But why not lambda syntax+inference? Probably still because of making quoted code have ambiguous syntax. But this ends up adding noise and increases the barrier on deciding when to put code into a tiny function. When using C# I'm constantly noticing how much extra code there is. It's just frustrating, and I don't feel like…

> how much extra code there is. It's just frustrating, and I don't feel like I'm getting a unique benefit in return (unlike, say, in Rust) Actually you are getting a benefit in return (unlike, say, in Rust) - the libraries. Verbose syntax is less complex in regard to writing the code, so more developers write the code. I have no scientific evidence to provide about the fact, but observations speak for themselves. Com…

No benefit over F# is what I mean - nothing about .NET requires C# to be verbose. With Rust, there's zero alternative that'll have the same guarantees and performance. So I can put up with the verbosity.

Re: What’s New in C# 7.0

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

>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 I hope there are better examples of Scala's syntactical advantages than this one, because it seems like the 'egyptian-style' vs 'next line style' brace bracket debate...

Yes there are plenty. The correct order of type declarations just ties in with the better syntax for generics and leads to an easier to read, more consistent language.

Re: What’s New in C# 7.0

#247

Earlier quoted context omitted.

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

Isn't Unity stuck with C# 2.0 ?

No, it supports c# 6 without dynamics but uses the 2.0 runtime. Now that mono is open source, they are updating the runtime to be current.

There's a project out there that swaps the mono compiler with Roslyn and gives some nice edit and continue features for Unity.

Re: What’s New in C# 7.0

#248
post #53

Earlier quoted context omitted.

A big advantage of this design over most of the other languages with tuples that I've seen is that their members can have names - that is, types can be anonymous but have named members. This I think hits a sweet spot as it's rare to not want fields to have names, but fairly common to want intermediate types that just bundle a few fields together where there's no good name that clarifies much.

Anonymous items with named fields are always only just one name away from being structs. That seems to me to be the least -sweet spot in the possibilities of (named/anonymous item) x (named/anonymous fields).

Out variables, and I imagine the various sorts of tuples, are created on the stack. Structs can by stack-allocated, or they can be heap-allocated, which has performance considerations which may be important in a given program. This feels much more like a case of right tool for the job than anything else.

Re: What’s New in C# 7.0

#249
post #183

Earlier quoted context omitted.

Not quite equivalent, since System.Tuple is immutable. So, at minimum: public class Complex { private readonly double _i; private readonly double _j; public double I {get {return _i;}} public double J {get{return _j;}} public Complex(double i, double j){ _i = i; _j = j; } } But System.Tuple is also IComparable, IStructuralComparable, IStructuralEquatable. I haven't had enough coffee yet to add all the boilerplate for…

Although with c# 6.0 (current release) you can simplify that to: public class Complex { public double I { get; } public double J { get; } public Complex(double i, double j) { I = i; J = j; } }

Even before C# 6.0, you could simplify it this way:

  public class Complex {
    public double I { get; private set; } 
    public double J { get; private set; }
    public Complex(double i, double j) {
      I = i;
      J = j;
    }
  }

Re: What’s New in C# 7.0

#250
post #75
post #53

Earlier quoted context omitted.

Anonymous items with named fields are always only just one name away from being structs. That seems to me to be the least -sweet spot in the possibilities of (named/anonymous item) x (named/anonymous fields).

It's a very big step in a language with nominal typing. Tuples with named fields are compatible (even across assemblies, if I remember correctly) so long as order, names and types match. Structs are not compatible in that manner.

Nice point. There's also the fact that with deconstruction being added as well, you don't even have to have the overhead of declaring a struct variable to get the return value and then dereferencing the fields, you can just deconstruct the tuple into variable if you so wish.
Post reply on HN