PerkLab / MCSTrack

Multi-camera spatial tracking
MIT License
0 stars 4 forks source link

Too many small files #49

Open lassoan opened 3 weeks ago

lassoan commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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.