Some things really have to be in the lowest possible level of your code to work, to come back later and bolt them on is incredibly difficult. Correctness of encoding, localization, and good unit testing are some of my usual examples; start with them from day one and they don't cost you that much, add them into a project that has gone for 10 man years without thought and you're in for some pain.
Undo functionality is like that. You have to start with some sort of ability to make it easy to create your "actions" in some way where every one of them can be reversed, and in some cases the OS itself makes that very hard. How do you undo "close program"? Like you said, but didn't quite spell out, with a fundamentally different OS where suddenly it's easy. You can make a Microsoft Windows program that will automatically open in the same state you left it in, but first of all, it's much harder than it is on a phone, and second, I very much hope that you thought of that from day one because otherwise you're probably in for some pain just refactoring your program to the point where it is possible....
Ideally you would work in some language that makes undo that easy, but it's really hard because so much of the system is fighting you. I've toyed with this but UIs themselves are fundamentally not undoable so you burn a lot of time just telling the UI how to roll back. It really needs to be fundamentally woven into the entire system and that will probably be decades, if ever.
Undo functionality is like that. You have to start with some sort of ability to make it easy to create your "actions" in some way where every one of them can be reversed, and in some cases the OS itself makes that very hard. How do you undo "close program"? Like you said, but didn't quite spell out, with a fundamentally different OS where suddenly it's easy. You can make a Microsoft Windows program that will automatically open in the same state you left it in, but first of all, it's much harder than it is on a phone, and second, I very much hope that you thought of that from day one because otherwise you're probably in for some pain just refactoring your program to the point where it is possible....
Ideally you would work in some language that makes undo that easy, but it's really hard because so much of the system is fighting you. I've toyed with this but UIs themselves are fundamentally not undoable so you burn a lot of time just telling the UI how to roll back. It really needs to be fundamentally woven into the entire system and that will probably be decades, if ever.