Click here to Skip to main content
15,069,581 members

Survey Results

Rate these 5 C# language improvements

Survey period: 30 Aug 2021 to 6 Sep 2021

For the C# devs. The language grows, so rate some of these additions from 1 = completely useless to 5 = Best thing since sliced bread.

OptionResponses Avg  
Implicit new: MyClass x = new()5233.05
Syntax patterns c is >= 'a' and <= 'z'5232.80
Switch: myVar switch { "value" => value, ... _ }5233.00
Null-coalescing assign: myList ??= new List<int>();5233.20
Indices and range: mystring[1..^4]5233.10



 
GeneralI'm looking forward to them... Pin
Gary R. Wheeler31-Aug-21 15:07
MemberGary R. Wheeler31-Aug-21 15:07 
GeneralThey're all useless to me. Pin
RafagaX31-Aug-21 6:48
professionalRafagaX31-Aug-21 6:48 
GeneralWhy do they even bother to use new. Just use MyClass x; and new it in GC internally Pin
steveb31-Aug-21 2:59
Membersteveb31-Aug-21 2:59 
GeneralRe: Why do they even bother to use new. Just use MyClass x; and new it in GC internally Pin
BillWoodruff5-Sep-21 13:58
mveBillWoodruff5-Sep-21 13:58 
Generalmost of them are useless Pin
Stepan Hakobyan30-Aug-21 20:26
professionalStepan Hakobyan30-Aug-21 20:26 
GeneralRe: most of them are useless Pin
hakimio30-Aug-21 21:11
Memberhakimio30-Aug-21 21:11 
GeneralMixed bag Pin
r_hyde30-Aug-21 20:01
Memberr_hyde30-Aug-21 20:01 
GeneralAre any of them even supported in .net 4.x? Pin
Dan Neely30-Aug-21 3:34
MemberDan Neely30-Aug-21 3:34 
GeneralRe: Are any of them even supported in .net 4.x? Pin
markrlondon30-Aug-21 3:52
Membermarkrlondon30-Aug-21 3:52 
GeneralRe: Are any of them even supported in .net 4.x? Pin
Richard Deeming30-Aug-21 21:53
mveRichard Deeming30-Aug-21 21:53 
GeneralRe: Are any of them even supported in .net 4.x? Pin
BillWoodruff5-Sep-21 14:01
mveBillWoodruff5-Sep-21 14:01 
GeneralRe: Are any of them even supported in .net 4.x? Pin
Matt McGuire31-Aug-21 4:29
professionalMatt McGuire31-Aug-21 4:29 
GeneralRe: Are any of them even supported in .net 4.x? Pin
Brisingr Aerowing31-Aug-21 10:07
professionalBrisingr Aerowing31-Aug-21 10:07 
GeneralMeh Pin
ronlease30-Aug-21 2:36
professionalronlease30-Aug-21 2:36 
GeneralMissing option Pin
Greg Utas30-Aug-21 2:03
mvaGreg Utas30-Aug-21 2:03 
GeneralMore like syntactic sugar ... Pin
Amarnath S30-Aug-21 1:02
professionalAmarnath S30-Aug-21 1:02 
GeneralNull-coalescing assign - maybe useful? Pin
Slacker00730-Aug-21 0:52
professionalSlacker00730-Aug-21 0:52 
GeneralRe: Null-coalescing assign - maybe useful? Pin
Sander Rossel30-Aug-21 2:24
professionalSander Rossel30-Aug-21 2:24 
GeneralRe: Null-coalescing assign - maybe useful? Pin
James Lonero31-Aug-21 12:51
MemberJames Lonero31-Aug-21 12:51 
GeneralThey're all just shortcuts... PinPopular
Sander Rossel29-Aug-21 22:05
professionalSander Rossel29-Aug-21 22:05 
Nothing we couldn't do in C# 1.0, just a bit shorter (and in some cases less readable / takes some getting used to) Sniff | :^)

The real improvements over the years, for me, would have to be LINQ (what a game-changer!), anonymous types and tuples (alright, tuples are a shortcut too, but a huge one!).
Those really change the way I write my code.

Furthermore, improvements in (ASP).NET Core, like having a default JSON settings file instead of XML, having a built-in IoC container, having Azure extensions, etc. really makes my life a lot more simple.
And being able to use them in .NET Framework (because they're .NET Standard) also helps Smile | :)

PraiseRe: They're all just shortcuts... Pin
Christiaan van Bergen29-Aug-21 22:43
professionalChristiaan van Bergen29-Aug-21 22:43 
GeneralRe: They're all just shortcuts... Pin
Mladen Janković2-Sep-21 4:23
MemberMladen Janković2-Sep-21 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.