True friendship is never serene.
|--Marquise de Sévigné|
In The Ethics, Aristotle writes of friendships, both between equal friends and between unequal friends, and discusses the mutual responsibilities and obligations necessary to maintain healthy relationships. In this short chapter, I intend to show how avoiding friendship simplifies implementations and avoids unnecessary breaking of encapsulation.
Scott Meyers’ principle of the use of nonmember functions over member functions as a tactic for increasing encapsulation is both worthy and widely employed. I follow this whenever it’s appropriate. There’s a common and totally unnecessary abuse of this principle, ...