In multi-inheritance, the order of base contracts is very important. When a contract inherits from multiple contracts, there will be only one contract created. Solidity copies code from all inherited contracts into inheriting contract. If inheritance leads to the name conflicts of modifier or function in one contract, an error will occur. By the same token, if there are name conflicts between event and modifier, or between event and function in contract, an error will be triggered.
Solidity supports multiple inheritance, meaning that one contract can inherit
several contracts. Multiple inheritance introduces ambiguity called Diamond Problem: if two or more base contracts define the same function, which one should be called in the child contract? Solidity deals with this ambiguity by using reverse C3 Linearization (an algorithm used primarily to obtain the order in which methods should be inherited in the presence of multiple inheritance), which sets a priority between base contracts. That way, base contracts have different priorities, so the order of inheritance matters. Neglecting inheritance order can lead to unexpected behavior. When inheriting multiple contracts, especially if they have identical functions, a developer should carefully specify inheritance in the correct order.
The rule of thumb is to inherit contracts from more/general/tomore/specific/.
A programming language supporting multiple inheritance should solve several
problems. One of them is diamond inheritance problem. Solidity solution for Diamond Problem is based on Python, which uses C3_linearization mechanism to force converting base contracts to a directed acyclic graph (DAG).