Quantcast
Channel: Why use getters and setters/accessors? - Stack Overflow
Viewing all articles
Browse latest Browse all 38

Answer by Rakesh Singh for Why use getters and setters/accessors?

$
0
0

One relatively modern advantage of getters/setters is that is makes it easier to browse code in tagged (indexed) code editors. E.g. If you want to see who sets a member, you can open the call hierarchy of the setter.

On the other hand, if the member is public, the tools don't make it possible to filter read/write access to the member. So you have to trudge though all uses of the member.


Viewing all articles
Browse latest Browse all 38

Trending Articles