|
|
|
|
|
by viraptor
6098 days ago
|
|
Ok... maybe it's because I like to program the functional way (in imperative languages), but I've never found a reason to rollback local variable changes. That's because local variables don't "fail" and don't need to be rolled back. I see why it's a nice solution but I've never really seen the problem. What I normally do is: operate on temporaries (or copied parameters), change remote resource (it's safe to just rollback resource changes and exit here in case of problems), then change "the state" when operations cannot fail any more. Is there any real-live problem that needs local variables rollback? (that is shorter / nicer than returning the result from temporary locals) I'd really like to see it. |
|