I came across this line in Effective C ++:
Public funds are unencapsulated, and practically speaking, unencapsulated funds are unchangeable, especially for widely used classes. For widely used classes, the most in need of encapsulation, because these are the ones that can benefit most from the ability to replace one implementation, better one
What does the author mean “Public funds, unencapsulated and practically speaking, unencapsulated means unchangeable”?
And how unencapsulated unchangeable?
. - , - , , . , - , , , . ; , , , - .
- . , , .
, . , ( ), .
++; . , , .
- , . "" , , ( , ).
, , , , , .
, , . , , ( , ).
, ( ). , . " ".
"" , , :
std::string getStringWithKey(int index);
, - . : , ( ), , , , .
, , , , .
, . , , , , .
He refers to data members, and he says that publicly publicizing data elements as part of an open interface means that you can never change their nature, that is, name and type.