A C# developers who went into coma in 2012 after learning about async/await and ASP.NET MVC can be awakened today and be instantly productive. Although he might go into coma again if he finds out .Net is now open source, cross-platform, and that we deploy to "Linux containers".
What's new in C# 12: overview
31–40 of 100 posts
Re: What's new in C# 12: overview
#32I love that Java and C# (not sure about VB.NET and F# in the .NET ecosystem) are continuing to get handy language features instead of collecting dust. The array syntax stuff is a nice win. Having other languages be the guinea pigs for language features is a good way to go.
C# has always been pretty good about evolving the language. Java has recently left the freezer and seems to be catching up as well. I don't use Java but I see people excited about new releases since v11 or so.
Re: What's new in C# 12: overview
#33There is PolySharp project that enables you to use most of C#11 features in legacy .NET Framework: https://github.com/Sergio0694/PolySharp - Seems that C#12 features are planned to be implemented: https://github.com/Sergio0694/PolySharp/issues/78
I'm using PolySharp where I'm stuck with .NET Framework 4.6 and I don't have any issues.
Hope one day I'd see concise syntax for catch and/or try expressions: https://github.com/dotnet/csharplang/discussions/2734 - but there is a lot of resistance.
Re: What's new in C# 12: overview
#34Earlier quoted context omitted.
First: drop e2e, unit, etc distinction It is irrelevant and driven by some testing evangelists Tests are either quick or slow and may touch external stuff, thats mostly it. Whats wrong with mocks? If they lead to scenarios where your tests are green, but app doesnt work then it sucks. Ive witnessed projects with all green tests but app wasnt even waking.
People downvoting you don’t do testing and are upset.
Re: What's new in C# 12: overview
#35Not sure if I like primary constructors. TBH, the following feature of Dart that I like: class Point { public Point(this x, this y); int x; int y } Everything else seems like small quality of life improvements. And still patiently waiting for the following to be legal: int result = some_variable switch { a => callAFunctionReturningVoid(); 1, b => 2, };
What does it even mean? Multi-statement lambdas without return statement, I get it, but what is the return value? And returning a void to int? How is it all supposed to work? What the trailing comma means? Inconsistent way of dealing with things that may confuse developers just results in that proposal resisted.
Re: What's new in C# 12: overview
#36Re: What's new in C# 12: overview
#37I stopped paying _a lot_ of attention to new C# features a few versions ago. While I like other syntaxes too (Python flexibility is really enjoyable), once my mind switches to "C# mode" I don't miss any other thing from more dynamic languages, at all. I feel that recent "features" are more in the "things I can do with a preprocessor or a code generator" than real language enhancements. Of course, I can be (and I'm pr…
>I feel that recent "features" are more in the "things I can do with a preprocessor or a code generator" than real language enhancements. Well, you can hack a lot with code gen, but thats not the way, imo. But using your logic: are generics a feature? Since you could achieve almost identical results with code gen hacks
We have generics since .NET 2 (2005 IIRC) and at the time, the lang improvements had a reason to exist (framework support in some cases). At the time it was a nice thing to add, if you ask me. For me, the next big thing, if you ask, was LINQ.
A few years later, I feel it's not the case with recent additions. But my comment is very subjective, of course.
As I said, I can be very wrong. It's just that I find he lang "very complete", if that's a thing, since a few years.
Re: What's new in C# 12: overview
#38I get why InterceptsLocation can be useful, but why not make a more generic version that doesn't work with magic line and character offsets? Something as innocuous as a code formatter will totally break this feature. So strange.
Re: What's new in C# 12: overview
#39Primary Constructors and Collection Syntax seem good. I think with target typed new and this new collection syntax I probably won't use var anymore.
If you want to write out Dictionary>> instead of having it inferred then go for it I guess.
Re: What's new in C# 12: overview
#40Earlier quoted context omitted.
C# has always been pretty good about evolving the language. Java has recently left the freezer and seems to be catching up as well. I don't use Java but I see people excited about new releases since v11 or so.
Yeah, it feels like Java (the language, not the JVM or ecosystem) was stuck in limbo since generics were added in Java 5, during that time C# came out and overtook it in terms of features / developer ergonomics.
Still there are plenty of markets where even .NET doesn't have a presence, like real time embedded systems, factory automation hardware, copiers, mainframes, blueray players, M2M gateways, and an OS being used by 80% of the planet, as Microsoft botched their own when it was already achieving 10% in Europe.
I love both platforms, however .NET cross-platform story still needs a bit of improvement versus where Java has been used in the last 28 years.
And DevTools eagerness to hinder it as means to sell Visual Studio licenses doesn't help.