openengine icon indicating copy to clipboard operation
openengine copied to clipboard

Rewrite MPN code

Open atas76 opened this issue 3 months ago • 0 comments

I am not happy with the MPN processing code as it is. It is already growing into a maintenance nightmare, where the logic is about reading my own mind and putting the right values in the "right" places, which seem arbitrary and unintuitive at first glance.

A first step towards its improvement is to do some housekeeping, like common best practices, but I think a more drastic approach is required in the less short term (something along the lines of a partial rewrite, while the codebase is still relatively small). One idea would be to separate the construction of the 'flow chain' of events from their actual processing, so that 'dynamic' interventions are integrated more naturally with the data, and the processing and presentation logic are not mixed with 'decision making' logic and (chance) outcome handling.

But still cutting my teeth at this point is welcome, in order to identify as many of the potential issues to be addressed as possible.

UPDATE

It very difficult to debug and reproduce bugs with enough confidence. I need to rewrite the code, without altering something in its logic conceptually, but do the implementation changes mentioned above.

atas76 avatar Mar 20 '24 11:03 atas76