demikernel
demikernel copied to clipboard
[build] Fix the super vs. self vs. crate inconsistency
Context
The codebase currently uses a mix of super vs. self vs. crate methods to specify references. It would be good to have consistency.
Proposed Solution
Finalize and use the same method across the codebase.
Alternative solutions
This is not a bug, but it would make the code easier to read/consistent if we just use one method everywhere. This is possibly applicable to other repos in Demikernel, as well.
Super SHOULD NOT be used. Rationale:
- If you are using super, it means that you are trying to re-use some component, which is AWESOME.
- However, if you properly architected software, the component would be module-visible or crate-visible.
- Super allows people to introduce cycle dependencies and tightly coupled designs.
- This is similar of having relative includes in C.
@ppenna - Does this "don't use super" apply even to "mod tests"? I.e. Unit tests that are present in the same file? Offhand, I wouldn't think that would cause any problems.
@BrianZill I agree with you that this does not apply for unit tests that are present in the same file.