Allen Holub wrote “You should never use get/set functions”, is he correct? [duplicate]
问题 This question already has answers here : Why use getters and setters/accessors? (38 answers) Closed 4 years ago . Allen Holub wrote the following, You can't have a program without some coupling. Nonetheless, you can minimize coupling considerably by slavishly following OO (object-oriented) precepts (the most important is that the implementation of an object should be completely hidden from the objects that use it). For example, an object's instance variables (member fields that aren't