Click here to Skip to main content
15,347,963 members

Survey Results

For the C# devs: expression body or old school functions?

Survey period: 21 Feb 2022 to 28 Feb 2022

Do you prefer the expression body public override string ToString() => "I am an object"; or the traditional public override string ToString() { return "I am a string"; }?

OptionVotes% 
I prefer the shortened expression body syntax13717.13
I prefer traditional functions31639.50
It depends on the situation18122.63
I don't care8911.13
I'd never heard of expression body definitions779.63



 
GeneralGeez, you could have come up with a simpler example Pin
Marc Clifton22-Feb-22 9:43
mvaMarc Clifton22-Feb-22 9:43 
GeneralI hate the proliferation of arrow functions throughout the language Pin
Dan Neely22-Feb-22 8:36
MemberDan Neely22-Feb-22 8:36 
GeneralRe: I hate the proliferation of arrow functions throughout the language Pin
Kate-X25722-Feb-22 22:12
MemberKate-X25722-Feb-22 22:12 
GeneralThank you traditionalists Pin
James Lonero22-Feb-22 6:43
MemberJames Lonero22-Feb-22 6:43 
GeneralRe: Thank you traditionalists Pin
Ravi Bhavnani22-Feb-22 7:43
professionalRavi Bhavnani22-Feb-22 7:43 
GeneralRe: Thank you traditionalists Pin
den2k8822-Feb-22 8:15
professionalden2k8822-Feb-22 8:15 
GeneralRe: Thank you traditionalists Pin
DanM222-Feb-22 9:59
MemberDanM222-Feb-22 9:59 
GeneralThere goes using => for something useful... Pin
Kirk 1038982122-Feb-22 2:45
MemberKirk 1038982122-Feb-22 2:45 
Generalwhat I care about is why ToString being overridden Pin
maze321-Feb-22 23:58
professionalmaze321-Feb-22 23:58 
GeneralHold on ... lemme search through my [codeCp] database ... Pin
RedDk21-Feb-22 6:49
MemberRedDk21-Feb-22 6:49 
Generalwhy is => preferred over {} for those write the code to be interpreted - compiled ? Pin
MarcusCole683321-Feb-22 5:35
professionalMarcusCole683321-Feb-22 5:35 
GeneralRe: why is => preferred over {} for those write the code to be interpreted - compiled ? Pin
trønderen21-Feb-22 7:17
Membertrønderen21-Feb-22 7:17 
GeneralRe: why is => preferred over {} for those write the code to be interpreted - compiled ? PinPopular
#realJSOP21-Feb-22 23:42
mva#realJSOP21-Feb-22 23:42 
GeneralRe: why is => preferred over {} for those write the code to be interpreted - compiled ? Pin
J. Frank Reeves22-Feb-22 2:37
MemberJ. Frank Reeves22-Feb-22 2:37 
GeneralRe: why is => preferred over {} for those write the code to be interpreted - compiled ? Pin
jochance22-Feb-22 5:22
Memberjochance22-Feb-22 5:22 
GeneralRe: why is => preferred over {} for those write the code to be interpreted - compiled ? Pin
Member 1044734222-Feb-22 6:34
MemberMember 1044734222-Feb-22 6:34 
GeneralPinheads Pin
lucanor21-Feb-22 1:52
Memberlucanor21-Feb-22 1:52 
GeneralRe: Pinheads Pin
KarstenK21-Feb-22 2:08
mveKarstenK21-Feb-22 2:08 
GeneralRe: Pinheads Pin
musefan21-Feb-22 3:00
Membermusefan21-Feb-22 3:00 
GeneralRe: Pinheads Pin
KarstenK22-Feb-22 5:19
mveKarstenK22-Feb-22 5:19 
GeneralRe: Pinheads Pin
Wendelius21-Feb-22 4:41
mveWendelius21-Feb-22 4:41 
GeneralRe: Pinheads Pin
trønderen21-Feb-22 7:10
Membertrønderen21-Feb-22 7:10 
GeneralRe: Pinheads Pin
Member 823466122-Feb-22 2:38
MemberMember 823466122-Feb-22 2:38 
GeneralRe: Pinheads Pin
OriginalGriff22-Feb-22 3:20
mveOriginalGriff22-Feb-22 3:20 
GeneralI have so few one-line methods... PinPopular
#realJSOP20-Feb-22 23:18
mva#realJSOP20-Feb-22 23:18 

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.