✅ C# best practices clarification
By convention, which is preferable to use? Getter and Setter methods or properties? Are the equivalent? Or is there a benefit to either? (I'm still new to C#).
6 Replies
Properties
We ain't writing Java around these parts
lolll
straightforward
is there a reason why visual studio offers that as a "refactoring"? is that a style microsoft supports/ are there C# coders in the wild that are doing it that way?
(kinda offtopic question but yeah)
Some learning-averse Java refugees might still be writing boilerplate getters and setters ig
Besides that, no idea why would anybody write out setter and getter methods
Not sure why it's a refactoring either
I'd sooner expect one that simply introduces a backing field, but still utilizes the property
$getsetdevolve
can be shortened to
can be shortened to
can be shortened to
can be shortened to
Refactoring to step 3 or 4 on this scale
Not to step 1
good stuff.thanks!