I cant find the blog post now (its probably 20ish years old now), from the creator of AutoCAD (John Walker, I beleive). Where he details all the issues he had with various diets and weight loss plans. Finally he looked at the issue from a engineers point of view, and eventually came up with a solution that worked for him. I am under-weight all my life, so I cannot speak to the method myself, but he seemed quite logical to me. He more or less stated that the human body could be considered like a rubber bag with a hole in each end and that if the calorie in number exceeded the calorie out number then weight goes up, with the added complication of water retention (as far as I know, most programs recommend that you weight yourself at the same time every day so as to get a more accurate reading, due to water retention), and as such devloped an excel sheet which would show a rolling average of weight (like the way they guess the weather or some stocks). This he found, helped with motivation, instead of seeing big swings from day to day, a steady small reduction is seen via the charts instead.
I tried to google the blog, but couldnt find it, however it appears that he has released books and other such materials relating to it since then.
This isnt the post I read, however, it looks like some of the tools he created exist here:
https://www.fourmilab.ch/hackdiet/
Note, as stated above, my struggle with weight is gaining, not loosing, so I have not delved into this stuff on a deeper level, however, what drew me into the original post, was the amount of research he did in relation to how much calories various activities will burn.