Rework frequently used anti-patterns in the codebase
Some commonly used anti-patterns that make our lifes harder while working with FEX
- Re-use of class names with different namespaces (makes navigation, search and replace, debugging hard)
- Overly, inconsistently namespaced codebase
- File names that don't match the class name, or missmatching .h/.cpp file names
- Inline forward declarations in header files
- Inconsistent grouping of helper libs
These should all be addressed.
- Broader use of
virtual interfacesto hide implementation details - Investigate C++ modules [2024+, when ubuntu 20.04 is no longer a supported target]
From #1842 code ranges bug -> analysis needs to not affect global state.
We also need to have strong, uniform, consistent and easy to use primitives to leverage Design by Contract
I've been using asserts like
LogMan::Throw::AFmt(CTX->CodeInvalidationMutex.try_lock() == false, "CodeInvalidationMutex needs to be unique_locked here");
but they are fragile (eg, this one can't tell the mutex is unique_locked and from our thread as it sure, it just checks if it is any locked from any thread) and unstructured.
Refs:
- https://en.wikipedia.org/wiki/Design_by_contract
- https://dlang.org/spec/contracts.html