djay / covidthailand

Thailand Covid testing and case data gathered and combined from various sources for others to download or view
126 stars 15 forks source link

restructure code making files smaller #93

Open djay opened 3 years ago

djay commented 3 years ago

make it easier for new people to find code and understand it

djay commented 3 years ago

@reduxionist thoughts?

reduxionist commented 3 years ago

I think this would make it much easier to onboard new contributors to the project as it can be hard to puzzle out how things works when you click the outline view and just get 2 functions for covid_plot, versus 50+ for the covid_data module even though the latter is only twice as many SLoC as the former.

It's all working fine as purely procedural code, but are there components of the restructuring you see becoming OOP? Dashboard so often end up being ugly piles of OOP for some reason... :wink:

Despite focusing on covid_plot first in my comment, I think both tasks are equally valuable. covid_data definitely qualifies for multi-module status now, IMHO.

djay commented 3 years ago

The only thing I was thinking of making an object for was to contain all the various dataframes. To make it easier for scrapers to add to multiple frames and easier to pass to the plot. Some methods could move to it like import and export and don't think a lot needs to.

reduxionist commented 3 years ago

Yeah that sounds reasonable to me if you decide to go there, nothing radical just a structure that some devs may be more comfortable wrapping their brains around. idk. my coding history predates my knowledge of OOP, so to me it's six of one a half-dozen of the other... ;)