by sdeframond · 8mo ago · 0 comments
Sorry, not really an answer to your problem. But I feel you, this is a genuinely hard problem.
Keep in mind that, pretty often, the reason something is the way it is comes down to "no real reason", "that seemed easier at the time" or "we didnt know better". At least if you don't work on critical systems.
For this particular case I like to put in a comment next to the weird thing that seems out of place. It can be a short summary and the link to a specific ticket for example.
Also, tests.
Edit: actually id like to emphasize the need for tests. One must be able to refactor code without fearing to break undocumented requirements.