7 ms·
I'm not advocating using getters/setters in Python. Just pointing out that you can access "private" members. I don't typically use getters and setters in JavaS
by jbail 16y ago
I'm not advocating using getters/setters in Python. Just pointing out that you can access "private" members. I don't typically use getters and setters in JavaScript either.
Java, on the other hand, kind of forces you into using getters and setters because the POJO is so ingrained into the ecosystem. That said, if you write Android apps in Java, you should avoid getters and setters because they aren't really necessary and they create extra overhead.
- nivertech 16y agoOne of the first textbooks on PL/1 also stated: "you should avoid using subroutines because they they create extra overhead" ;) 40 years later and we still there ...