Is defining get/set methods for every field overkill?
Sat Nov 19 10:17:19 UTC 2022
On Saturday, 19 November 2022 at 09:51:09 UTC, []() {}() wrote:
> ...
> no. in C# it breaks ABI. that is why its not acceptable in my
> team.
>
of course that's not the reason we don't use public member
variables in classes.
the reason we don't use them, is because (1) we always anticpiate
change including the need to implement (and change) business
rules associated with the objects data (using setter/getters),
and (2) we always prioritise the stability of the public
interface of a class at the time of design.
if neither of those are your concern, in production-level code,
I'd be really surprised (and shocked).
More information about the Digitalmars-d-learn
mailing list