Hello, I'm creating setters and getters for a class, for visual purposes is it better this way or compressed in a single line (as in the red box)?

Hello, I'm creating setters and getters for a class, for visual purposes is it better this way or compressed in a single line (as in the red box)?

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Sep 21, 2022, 2:48 AM EDT
In C# you don't need to create setters and getters explicitly most of the time, you can use properties, often auto properties
Sachin SinghRank #66 · 26.2K reputationPosted Sep 21, 2022, 1:59 AM EDT
for me less lines of code is always good. So, use the lambda's one.
Uday DodiyaRank #239 · 10.3K reputationPosted Sep 21, 2022, 5:09 AM EDT
Yes, It is good one.