4 ms·
> I can't speak to Java, but in C#, the original goal was to reduce coupling. If you want to reduce coupling, why not write a real method? Get/Set couples you
by HumanDrivenDev 9y ago
> I can't speak to Java, but in C#, the original goal was to reduce coupling.
If you want to reduce coupling, why not write a real method? Get/Set couples you to your class fields. If you change your class fields, your getters and setters all suddenly become useless.
Maybe I just hate the middle ground (:
- bunderbunder 9y agoNo, they don't. I have, plenty of times in the past, changed a class's implementation details in a way that results in fields being removed, without having to create a breaking change in the associated property getters and setters. All it took was changing their implementation to work with whatever the new thing was.