<div dir="ltr"> I met several bugs that remind me to raise this question. In PETSc, object of type A can arbitrarily access object of type B's data. But designer of B may later change the meaning of its data (and of course, update B's interfaces, which are usually local to few files). The designer may think the job is done, but actually it is not.  He/she has to grep the code to know where its data members are accessed (that is relatively easy to get) and what is the contract, for example, is an array assumed to be sorted (that is hard to know).  With C++, one can use private to minimize data exposure.<div><br><div><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr">--Junchao Zhang</div></div></div></div></div></div></div>