LWN.net Logo

Crash-only software: More than meets the eye

Crash-only software: More than meets the eye

Posted Jul 13, 2006 11:15 UTC (Thu) by nix (subscriber, #2304)
Parent article: Crash-only software: More than meets the eye

The Emacs autosave feature makes clear another aspect of crash-only software design applicable to systems with persistent state: that sometimes you want to have an explicit 'save' option *as well*, such that the persistent state that is saved at shutdown is only used to restore the state on startup. This is especially true if there's a lot of state.

Many text editors, including a number of vi implementations (not vim) implemented their preserve feature by saving the file periodically, not to /var/tmp or a .swp file, but to the original location. This turned out to be annoying if you decided your changes were a bad idea: :q left the file half-way altered. vim doesn't have this problem, and of course Emacs never did (it would be rather obvious if M-x revert-buffer stopped working, and while in fact it was broken at one point in the XEmacs 21.4 releease cycle, this was a bug, not intentional!)

This particular approach to state saving was *very* common in the DOS/Windows world for a time, and was exceptionally annoying: if anything, it was more annoying than a system with no automatic state saving would have been. It felt like making any change was horribly irrevocable, not least because these systems either had short undo queues or didn't save them on crashing.


(Log in to post comments)

No need for explicit saving

Posted Oct 22, 2008 4:34 UTC (Wed) by pgan (guest, #54573) [Link]

I think it's simpler for the user to never think about saving. The program should just save the history, and the user will find the document (or other object) in the state they left it. If they don't like the current state, they can undo to one they like.

that just doesn't work well

Posted Oct 22, 2008 8:17 UTC (Wed) by dlang (✭ supporter ✭, #313) [Link]

the OLPC people believed the same thing, and the result is a flood of junk with the documents that you care about sprinkled though the junk. it's almost impossible to retrieve documents after a very short timeframe.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds