Rollback your app?

I was driving to the doc earlier today, and a thought struck me while thinking about programming languages and medical systems. I have several friends and relatives that work “in medicine” (a doctor; an anesthetist; a dietitian; and even an ambulance driver). I was thinking about the way the language you program in has a direct link to how stable and “safe” your code is. If I code something in Java and C++, I know that the C++ code will be faster (most of the time), but I will always be less sure of it, C++ doesn’t deal with failure nearly as well as Java does (mostly because Java has a nice big VM underneath it).

So the thought was this: transactions in you language. So I can set a save-point, open and close transactions, commit and rollback bits of memory and disk, as a language feature. It would make dealing with failure a lot easier, since you could say “attempt this transaction 3 times, delay 500ms between each attempt, if they all fail, do xyz”, instead of simply “try { … } catch(…) { … } finally { … }”.

Java’s try, catch, (and most importantly) finally, is really really awesome and all, but transactions mean that if the code fails, you don’t have to worry about where it failed, so theres less or no cleanup. Anyways… just an idea 😉


2 Responses to “Rollback your app?”

  1. Raoul Duke Says:

    read up on “composable memory transactions” i think aka “shared transactional memory” coming soon to a haskell or .net language near you.

  2. Jason Says:

    Thanks for the hint… reading up now 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: