DEV Community

Discussion on: How you can reduce usage of getter methods in your code

 
zhu48 profile image
Zuodian Hu

Oh, OK. Yeah I agree with you; for modularity and stability, it's better to opaquely define how comparison should work than to expose data and let the user misuse and depend on that data. I think the big disagreement most people have with that idea is that encapsulation isn't always the most important thing in the world.