AnthonyMichaelTDM / DRG-Save-Editor

Rock and stone!
GNU General Public License v3.0
106 stars 17 forks source link

[Proposal] - Refactor the program into more easily managed files #75

Open simon-wg opened 1 month ago

simon-wg commented 1 month ago

I'm planning to do a major refactor once #73 is merged in order to make the program more easily maintainable.

The current structure of ~1500 lines is a bit rough to navigate when adding features. So dividing up the parts into their own files would provide an easier overview of the program, as well as make it easier to implement new features, and modify existing ones.

Thoughts on this? @AnthonyMichaelTDM

AnthonyMichaelTDM commented 1 month ago

I absolutely agree, I've been meaning to start on that myself for a while now but keep putting it off, I'm looking forward to seeing what you do here and am absolutely willing to collaborate as necessary

AnthonyMichaelTDM commented 1 month ago

I think the first step would be to migrate things away from using global state, or to consolidate all that "state management" to a separate module, the idea being to have more of the functions be "pure".

AnthonyMichaelTDM commented 1 month ago

you can see what I started in the code-refactoring branch, probably better to start fresh though.

simon-wg commented 1 month ago

I think I will start from scratch tbh. I'll probably start working on it tomorrow, and you can expect a PR around monday.

wahlp commented 1 month ago

thank goodness. i was getting tired of all the global keyword appearances

AnthonyMichaelTDM commented 1 month ago

Should I wait on releasing 1.9.1 (which will include some bug fixes (#83 and #84) and ergonomics improvements (#88)) for this to be done, or should we tackle this and #78 in 1.9.2?

I'm leaning toward the latter, but I'd like your input @simon-wg and @wahlp

wahlp commented 1 month ago

I agree with tackling the enhancements later. Getting the bug fixes out sooner would be best.

simon-wg commented 1 month ago

I agree that it's probably better to just release the fixes in 1.9.1.

As the progress is looking right now it will probably take a few more days to be "done" with the refactor. Adding proper testing afterwards will probably also take a couple of days.