Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many small files #49

Open
lassoan opened this issue Jun 19, 2024 · 2 comments
Open

Too many small files #49

lassoan opened this issue Jun 19, 2024 · 2 comments

Comments

@lassoan
Copy link
Collaborator

lassoan commented Jun 19, 2024

While the current source code is neatly organized in folders and files, the huge amount of tiny (few-line) files makes the code very tedious to read.

Is there a reason why we create separate files for just few lines of code?
Could we reorganize the code to have more balanced distribution of code in files - resulting in file sizes between about 5KB-20KB?

@tavaughan
Copy link

Is there a reason why we create separate files for just few lines of code?

Generally it's one file per class. There are possibly also a few files that each contain static functions.

Could we reorganize the code to have more balanced distribution of code in files - resulting in file sizes between about 5KB-20KB?

We could consolidate classes/functions into fewer files. There are, for example, many folders called structure that could be converted into individual python modules. Whether that would improve overall readability I'm not sure. I find most IDE's support ctrl-clicking on class or function names to take you to the source code. Then it's obvious from the tab/file name which tab is for which class. If the tab has a generic name like structures then it might be more difficult to remember where individual classes were (compounded further if there are multiple files called structures).

@tavaughan
Copy link

On a related note, there are some cases where multiple versions of the same small file exist, see #5 for an example. So the small files do warrant being revisited in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants