Closed badcodecat closed 3 weeks ago
While some cleanup would come in handy to the library, I feel like this change is more related to personal taste. I like to couple related code together and not split them across different files. I feel like having multiple tabs open and jumping between them decreases efficiency and increases mental overhead. That's why I split files based on abstraction and not struct hierarchy. Of course, this is very subjective.
When we add new stuff and the file gets too large, we can split it. But now I don't really think its worth the effort. It is not necessary.
Proposal
While looking through the codebase, I noticed that there are quite a few large files (a thousand lines or more). I propose splitting these files into smaller modules to make the codebase more readable, maintainable, and easier to navigate for newcomers (like me in this case!).
Example
As an example,
layout.rs
in lunex_engine defines theLayout
enum, but it also definesBoundary
,Window
,Solid
, andDiv
structs for use in theLayout
enum. In this case, I think it would be beneficial to move the layout modes (Boundary
,Window
,Solid
, andDiv
) into their own files, either in the same directory or in a subdirectory.Here's how the file structure could look after moving the layout modes into a subdirectory:
Here is a sample of the corresponding change in layout.rs:
Considerations
Of course this is just an aesthetic change, the proposal doesn't offer any technical improvements. If this is a change that you would like to see, I would be happy to try and implement it (to the best of my ability, erring on the side of caution as I am not familiar with the codebase).