4 ms·
Yes. If you have a struct, getters/setters are somewhat pointless, since member visibility control is only package level (protected/public depending on variable
by Scaevolus 9y ago
Yes. If you have a struct, getters/setters are somewhat pointless, since member visibility control is only package level (protected/public depending on variable name capitalization).
For interfaces, you can only invoke methods, so getters/setters are required.
- vvanders 9y agoYup, getters/setters in POJOs drive me up the wall. So much simpler in languages that have proper const/mutability qualifiers.
- fleshweasel 9y agoso..not Go :P
- vvanders 9y agoOh yeah, definitely not :)
- krylon 9y ago> proper const/mutability qualifiers I really like Go, but on the const/mutability front, it does no better than C, unfortunately.