Closed mgcth closed 5 months ago
How do you think the structure should be in order to avoid such side effects, and what side effects are you thinking of?
We could probably delete this class altogether
For example, get_periods
doesn't actually return anything, but just mutates an internal state periods
of the object
There are probably more examples.
I think it makes the code harder to test and reason about, and as a user, I would expect get_...
to return something and not only modify the object state.
I'd go for pure functions as much as possible, as long as we don't copy data unecessairly but that shouldn't be a big problem as the data here is relatively small for each request. It should simplify any future multithreading/async additions we'd want to add.
So... Should we pencil out a plan for how we want to structure things before we start remodeling? Or do you already have a blueprint like this in mind?
Maybe we should try to release version 0.1.0 first :)
Good point :)
Description
Reduce or eliminate (as much as possible) side effects from our methods. Along these lines, remove the Metobs class altogether and just use the individual components.