Skip to content

Declare class in one line #1659

Discussion options

You must be logged in to vote

Why is:

public class Foo => public void Bar() => Console.WriteLine("Bar");

better than

public class Foo { public void Bar() => Console.WriteLine("Bar"); }

AFAICT, you save 1 character...

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YairHalberstadt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #1659 on October 16, 2020 10:27.