Follow proven standards to reduce risk
Complex inheritance in public classes can leak implementation details, inhibit type evolution, and obscure documentation. Prefer using composition or simple inheritance to implement the required functionality.
Avoid mutating global variables, instead opting for dependency injection. This applies to function references as well as other kinds of values. Global variables make code difficult to test and reason about, and can lead to subtle bugs.
Complex inheritance hierarchies can leak implementation details and make code difficult to maintain. Prefer composition and clear interfaces over deep inheritance chains.